Class Activity

  • All Implemented Interfaces:
    java.io.Serializable

    public class Activity
    extends java.lang.Object
    implements java.io.Serializable
    Activity definition
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Activity​(Processus p, java.lang.String id, java.lang.String step, java.lang.String name, char type, boolean userDialog, char revers, java.lang.String moduleId)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void addData​(Data d)
      Add a data to the activity
      void addPermission​(java.lang.String group, char grant)
      Add permission
      java.util.Map<java.lang.String,​java.util.List<Data>> data()
      Get activity data
      void delPermission​(java.lang.String group, char grant)
      Delete permission
      Alert getAlert()
      Get deadline alert
      java.util.Iterator<Data> getData()
      Get iterator on activity data
      Data getData​(java.lang.String group, java.lang.String name)
      Get activity data
      java.lang.String getDeadline​(java.util.Date dt)
      Get the activity deadline
      java.lang.String getDisplay()
      Get activity translation
      long getDuration()
      Activity duration
      java.lang.String getHelp()
      Get activity long help
      java.lang.String getId()
      Get unique ID
      java.lang.String getLabel()
      Activity translation (alias to getDisplay)
      java.lang.String getMiniHelp()
      Get activity short help
      java.lang.String getModuleId()
      Get module ID
      java.lang.String getName()
      Get activity name
      Processus getProcessus()
      Get the process definition
      char getReversible()
      Reversibility mode to return to the previous activity
      java.lang.String getStep()
      Get step name (the short name of activity that will be used by the system)
      java.lang.String getTemplate()
      Get template
      char getType()
      Get activity type (BEGIN, END...)
      java.lang.String getUITemplate()
      Get UI template
      boolean isCancelGranted​(Grant g)
      Is cancel granted?
      boolean isCancelGranted​(java.lang.String group)
      Is cancel granted?
      boolean isReadGranted​(Grant g)
      Is read granted?
      boolean isReadGranted​(java.lang.String group)
      Is read granted?
      boolean isReversible()
      Is the activity can return to the previous activity?
      boolean isUserDialog()
      Is the activity a user dialog
      boolean isWriteGranted​(Grant g)
      Is write granted?
      boolean isWriteGranted​(java.lang.String group)
      Is write granted?
      void setAlert​(Alert alert)
      Set deadline alert
      void setDisplay​(java.lang.String d)
      Set activity translation
      void setDuration​(int max, char unit)
      Set the max duration of the activity (then send the deadline alert)
      void setHelp​(java.lang.String help)
      Set activity long help
      void setId​(java.lang.String id)
      Set unique ID
      void setModuleId​(java.lang.String id)
      Set module ID
      void setShortHelp​(java.lang.String shorthelp)
      Set activity short help
      void setTemplate​(java.lang.String template)
      Set template
      void setType​(char type)
      Set activity type
      void setUITemplate​(java.lang.String template)
      Set UI template
      void setUserDialog​(boolean b)
      Set whether the activity is a user dialog
      org.json.JSONObject toJSONObject()
      Generates a JSON object representation of the activity
      java.lang.String toString()
      Generates a string representation of the activity
      boolean userDialog()
      Deprecated.
      Use isUserDialog
      • Methods inherited from class java.lang.Object

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

      • Activity

        public Activity​(Processus p,
                        java.lang.String id,
                        java.lang.String step,
                        java.lang.String name,
                        char type,
                        boolean userDialog,
                        char revers,
                        java.lang.String moduleId)
        Constructor
        Parameters:
        p - Processus
        id - ID
        step - Step
        name - Name
        type - Type
        userDialog - With user dialog?
        revers - Reversibility mode
        moduleId - Module ID
    • Method Detail

      • getId

        public java.lang.String getId()
        Get unique ID
        Returns:
        Unique ID
      • setId

        public void setId​(java.lang.String id)
        Set unique ID
        Parameters:
        id - Unique ID
      • getModuleId

        public java.lang.String getModuleId()
        Get module ID
        Returns:
        Module ID
      • setModuleId

        public void setModuleId​(java.lang.String id)
        Set module ID
        Parameters:
        id - Module ID
      • getProcessus

        public Processus getProcessus()
        Get the process definition
        Returns:
        Processus definition
      • getStep

        public java.lang.String getStep()
        Get step name (the short name of activity that will be used by the system)
        Returns:
        Step name
      • getName

        public java.lang.String getName()
        Get activity name
        Returns:
        Activity name
      • setDisplay

        public void setDisplay​(java.lang.String d)
        Set activity translation
        Parameters:
        d - Activity translation
      • getDisplay

        public java.lang.String getDisplay()
        Get activity translation
        Returns:
        Activity translation
      • getLabel

        public java.lang.String getLabel()
        Activity translation (alias to getDisplay)
        Returns:
        Text
      • setShortHelp

        public void setShortHelp​(java.lang.String shorthelp)
        Set activity short help
        Parameters:
        shorthelp - Short help
      • getMiniHelp

        public java.lang.String getMiniHelp()
        Get activity short help
        Returns:
        Short help
      • setHelp

        public void setHelp​(java.lang.String help)
        Set activity long help
        Parameters:
        help - Long help
      • getHelp

        public java.lang.String getHelp()
        Get activity long help
        Returns:
        Long help
      • getType

        public char getType()
        Get activity type (BEGIN, END...)
        Returns:
        Activity type
      • setType

        public void setType​(char type)
        Set activity type
        Parameters:
        type - Activity type
      • userDialog

        @Deprecated
        public boolean userDialog()
        Deprecated.
        Use isUserDialog
      • isUserDialog

        public boolean isUserDialog()
        Is the activity a user dialog
        Returns:
        True if the activity needs a user dialog
      • setUserDialog

        public void setUserDialog​(boolean b)
        Set whether the activity is a user dialog
        Parameters:
        b - User dialog?
      • getReversible

        public char getReversible()
        Reversibility mode to return to the previous activity
        Returns:
        One of REVERS_*
      • isReversible

        public boolean isReversible()
        Is the activity can return to the previous activity?
        Returns:
        true if activity is reversible (other mode than REVERS_NONE)
      • setDuration

        public void setDuration​(int max,
                                char unit)
        Set the max duration of the activity (then send the deadline alert)
        Parameters:
        max - Quantity
        unit - Duration unit
      • getDeadline

        public java.lang.String getDeadline​(java.util.Date dt)
        Get the activity deadline
        Parameters:
        dt - Start date
        Returns:
        Date yyyy-MM-dd HH:mm:ss (start date + duration)
      • getDuration

        public long getDuration()
        Activity duration
        Returns:
        Activity duration
      • getAlert

        public Alert getAlert()
        Get deadline alert
        Returns:
        Deadline alert
      • setAlert

        public void setAlert​(Alert alert)
        Set deadline alert
        Parameters:
        alert - Deadline alert
      • data

        public java.util.Map<java.lang.String,​java.util.List<Data>> data()
        Get activity data
        Returns:
        Activity data
      • getData

        public java.util.Iterator<Data> getData()
        Get iterator on activity data
        Returns:
        All activity data
      • getData

        public Data getData​(java.lang.String group,
                            java.lang.String name)
        Get activity data
        Parameters:
        group - Group name of data
        name - Data name
        Returns:
        data definition
      • addData

        public void addData​(Data d)
        Add a data to the activity
        Parameters:
        d - data definition
      • addPermission

        public void addPermission​(java.lang.String group,
                                  char grant)
        Add permission
        Parameters:
        group - Group
        grant - Grant type
      • delPermission

        public void delPermission​(java.lang.String group,
                                  char grant)
        Delete permission
        Parameters:
        group - Group
        grant - Grant type
      • isWriteGranted

        public boolean isWriteGranted​(java.lang.String group)
        Is write granted?
        Parameters:
        group - Group
        Returns:
        True if write is granted
      • isWriteGranted

        public boolean isWriteGranted​(Grant g)
        Is write granted?
        Parameters:
        g - Grant
        Returns:
        True if write is granted
      • isReadGranted

        public boolean isReadGranted​(java.lang.String group)
        Is read granted?
        Parameters:
        group - Group
        Returns:
        True if read is granted
      • isReadGranted

        public boolean isReadGranted​(Grant g)
        Is read granted?
        Parameters:
        g - Grant
        Returns:
        True if read is granted
      • isCancelGranted

        public boolean isCancelGranted​(java.lang.String group)
        Is cancel granted?
        Parameters:
        group - Group
        Returns:
        True if cancel is granted
      • isCancelGranted

        public boolean isCancelGranted​(Grant g)
        Is cancel granted?
        Parameters:
        g - Grant
        Returns:
        True if cancel is granted
      • setTemplate

        public void setTemplate​(java.lang.String template)
        Set template
        Parameters:
        template - Template
      • getTemplate

        public java.lang.String getTemplate()
        Get template
        Returns:
        Template
      • setUITemplate

        public void setUITemplate​(java.lang.String template)
        Set UI template
        Parameters:
        template - UI template
      • getUITemplate

        public java.lang.String getUITemplate()
        Get UI template
        Returns:
        UI template
      • toJSONObject

        public org.json.JSONObject toJSONObject()
        Generates a JSON object representation of the activity
        Returns:
        Activity as JSON object
      • toString

        public java.lang.String toString()
        Generates a string representation of the activity
        Overrides:
        toString in class java.lang.Object
        Returns:
        activity as string