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)  
    • Method Summary

      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()  
      void delPermission​(java.lang.String group, char grant)
      Delete permission
      Alert getAlert()
      Deadline alert, may be null
      java.util.Iterator<Data> getData()
      Get all 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()
      To know if the activity can route to the previous one
      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()  
      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 a)  
      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 help)
      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.
      • 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)
    • 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 help)
        Set activity short help
        Parameters:
        help - 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.
      • 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()
        To know if the activity can route to the previous one
        Returns:
        Reversible ?
      • isReversible

        public boolean isReversible()
      • 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()
        Deadline alert, may be null
        Returns:
        Deadline alert
      • setAlert

        public void setAlert​(Alert a)
      • data

        public java.util.Map<java.lang.String,​java.util.List<Data>> data()
      • getData

        public java.util.Iterator<Data> getData()
        Get all 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
      • isWriteGranted

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

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

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

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

        public boolean isCancelGranted​(Grant g)
        Is cancel granted?
        Parameters:
        g - Grant
      • 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