Class ActivityFile

  • All Implemented Interfaces:
    java.io.Serializable

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

    Activity file for storing instantiated process data

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      ActivityFile​(Activity a, java.lang.String aid)  
    • Method Summary

      Modifier and Type Method Description
      DataFile addDataFile​(Data d)
      Add data
      DataFile addDataFile​(java.lang.String group, java.lang.String name)
      Add dynamic data
      DataFile addDataFile​(java.lang.String group, java.lang.String name, java.lang.String value)
      Add dynamic data with a value
      java.util.Map<java.lang.String,​java.util.List<DataFile>> dataFiles()  
      Activity getActivity()  
      java.lang.String getAID()
      Instance number of activity
      DataFile getDataFile​(java.lang.String group, java.lang.String name, boolean traceMissing)
      Retrieve context data from its path
      java.util.List<DataFile> getDataFiles()
      Retrieve all context data
      java.util.List<DataFile> getDataFiles​(java.lang.String group)
      Retrieve context data for a group
      java.lang.String getDataValue​(java.lang.String group, java.lang.String name)
      Retrieve context (first) value from its path
      java.io.InputStream getDataValueContent​(java.lang.String group, java.lang.String name, boolean deleteOnClose)
      Retrieve context file content part from its path
      java.lang.String getDataValueName​(java.lang.String group, java.lang.String name)
      Retrieve context file name part from its path
      java.lang.String getDeadline()
      Planned end date
      java.lang.String getEndDate()
      Actual end date
      java.lang.String getExternalURL()
      Prepare URL of external activity (Page.Name)
      java.lang.String getOwnerId()
      Owner is a user id, may be null if nobody uses the activity
      java.lang.String getPID()
      Instance number of process
      java.lang.String getPlanDate()
      Planned start date
      Processus getProcessus()
      Business process
      java.lang.String getStartDate()
      Actual start date
      char getStatus()
      State STATE_*
      java.lang.Long getWaitingTime()
      Waiting time in seconds from the previous activity (long process only)
      boolean isReadOnly()
      Is read only
      java.util.List<ObjectFieldSearch> loadFilters​(ObjectDB obj, Processus p)  
      java.lang.String parseTemplate​(java.lang.String templateTag)
      Complete with parsed values, common tokens...
      void removeDataFile​(java.lang.String group, java.lang.String name)
      Remove dynamic data
      void setAID​(java.lang.String aid)  
      void setDataFile​(java.lang.String group, java.lang.String name, java.lang.String value)
      Update mono value context data
      void setDataFile​(java.lang.String group, java.lang.String name, java.lang.String[] values)
      Update multi values context data.
      void setDataFile​(java.lang.String group, java.lang.String name, java.lang.String path, byte[] data)
      Update binary context data
      void setDataFile​(java.lang.String group, java.lang.String name, java.lang.String path, java.io.File file)
      Update file context data
      void setDataFile​(java.lang.String group, java.lang.String name, java.util.List<java.lang.String> values)
      Update multi-values context data
      void setDeadline​(java.lang.String d)  
      void setEndDate​(java.lang.String d)  
      void setNextStep​(java.lang.String nextStep)
      Force the next step
      void setOwnerId​(int userId)  
      void setOwnerId​(java.lang.String userId)  
      void setPID​(java.lang.String id)  
      void setPlanDate​(java.lang.String d)  
      void setReadOnly​(boolean b)  
      void setStartDate​(java.lang.String d)  
      void setStartDate​(java.lang.String d, boolean waitingTime)  
      void setStatus​(char s)  
      void setWaitingTime​(java.lang.Long wt)  
      java.lang.String toJSON()  
      java.lang.String toJSON​(ObjectDB obj, boolean metadata)  
      org.json.JSONObject toJSONObject()
      Generates a JSON object representation of the activity file
      java.lang.String toString()
      Generates a string representation of the activity file
      • Methods inherited from class java.lang.Object

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

      • ActivityFile

        public ActivityFile​(Activity a,
                            java.lang.String aid)
    • Method Detail

      • getActivity

        public Activity getActivity()
      • getProcessus

        public Processus getProcessus()
        Business process
        Returns:
        Processus
      • getAID

        public java.lang.String getAID()
        Instance number of activity
        Returns:
        AID
      • setAID

        public void setAID​(java.lang.String aid)
      • getPID

        public java.lang.String getPID()
        Instance number of process
        Returns:
        PID
      • setPID

        public void setPID​(java.lang.String id)
      • isReadOnly

        public boolean isReadOnly()
        Is read only
        Returns:
        Is read only ?
      • setReadOnly

        public void setReadOnly​(boolean b)
      • getStatus

        public char getStatus()
        State STATE_*
        Returns:
        Status
      • setStatus

        public void setStatus​(char s)
      • getOwnerId

        public java.lang.String getOwnerId()
        Owner is a user id, may be null if nobody uses the activity
        Returns:
        Owner
      • setOwnerId

        public void setOwnerId​(int userId)
      • setOwnerId

        public void setOwnerId​(java.lang.String userId)
      • getPlanDate

        public java.lang.String getPlanDate()
        Planned start date
        Returns:
        Planned start date
      • setPlanDate

        public void setPlanDate​(java.lang.String d)
      • getDeadline

        public java.lang.String getDeadline()
        Planned end date
        Returns:
        Deadline
      • setDeadline

        public void setDeadline​(java.lang.String d)
      • getStartDate

        public java.lang.String getStartDate()
        Actual start date
        Returns:
        Start Date
      • setStartDate

        public void setStartDate​(java.lang.String d)
      • setStartDate

        public void setStartDate​(java.lang.String d,
                                 boolean waitingTime)
      • getWaitingTime

        public java.lang.Long getWaitingTime()
        Waiting time in seconds from the previous activity (long process only)
        Returns:
        Waiting Time
      • setWaitingTime

        public void setWaitingTime​(java.lang.Long wt)
      • getEndDate

        public java.lang.String getEndDate()
        Actual end date
        Returns:
        End Date
      • setEndDate

        public void setEndDate​(java.lang.String d)
      • addDataFile

        public DataFile addDataFile​(java.lang.String group,
                                    java.lang.String name)
        Add dynamic data
        Parameters:
        group - Group
        name - Name
        Returns:
        DataFile
      • addDataFile

        public DataFile addDataFile​(java.lang.String group,
                                    java.lang.String name,
                                    java.lang.String value)
        Add dynamic data with a value
        Parameters:
        group - Group
        name - Name
        value - Value
        Returns:
        DataFile
      • removeDataFile

        public void removeDataFile​(java.lang.String group,
                                   java.lang.String name)
        Remove dynamic data
        Parameters:
        group - Group
        name - Name
      • addDataFile

        public DataFile addDataFile​(Data d)
        Add data
        Parameters:
        d - Data
        Returns:
        DataFile
      • getDataFile

        public DataFile getDataFile​(java.lang.String group,
                                    java.lang.String name,
                                    boolean traceMissing)
        Retrieve context data from its path
        Parameters:
        group - Group
        name - Name
        traceMissing - traceMissing ?
        Returns:
        context data
      • getDataValue

        public java.lang.String getDataValue​(java.lang.String group,
                                             java.lang.String name)
        Retrieve context (first) value from its path
        Parameters:
        group - Group
        name - Name
        Returns:
        context value
      • getDataValueName

        public java.lang.String getDataValueName​(java.lang.String group,
                                                 java.lang.String name)
        Retrieve context file name part from its path
        Parameters:
        group - Group
        name - Name
        Returns:
        file name
      • getDataValueContent

        public java.io.InputStream getDataValueContent​(java.lang.String group,
                                                       java.lang.String name,
                                                       boolean deleteOnClose)
        Retrieve context file content part from its path
        Parameters:
        group - Group of data
        name - Data name
        deleteOnClose - delete file after reading?
        Returns:
        data stream
      • getDataFiles

        public java.util.List<DataFile> getDataFiles​(java.lang.String group)
        Retrieve context data for a group
        Parameters:
        group - Group
        Returns:
        List of DataFile
      • getDataFiles

        public java.util.List<DataFile> getDataFiles()
        Retrieve all context data
        Returns:
        List of DataFile
      • dataFiles

        public java.util.Map<java.lang.String,​java.util.List<DataFile>> dataFiles()
      • setDataFile

        public void setDataFile​(java.lang.String group,
                                java.lang.String name,
                                java.lang.String value)
        Update mono value context data
        Parameters:
        group - Group
        name - Name
        value - Value
      • setDataFile

        public void setDataFile​(java.lang.String group,
                                java.lang.String name,
                                java.lang.String path,
                                byte[] data)
        Update binary context data
        Parameters:
        group - Group
        name - Name
        path - Path
        data - Data
      • setDataFile

        public void setDataFile​(java.lang.String group,
                                java.lang.String name,
                                java.lang.String path,
                                java.io.File file)
        Update file context data
        Parameters:
        group - Group
        name - Name
        path - Path
        file - File
      • setDataFile

        public void setDataFile​(java.lang.String group,
                                java.lang.String name,
                                java.util.List<java.lang.String> values)
        Update multi-values context data
        Parameters:
        group - Group
        name - Name
        values - Values
      • setDataFile

        public void setDataFile​(java.lang.String group,
                                java.lang.String name,
                                java.lang.String[] values)
        Update multi values context data.
        Parameters:
        group - Group
        name - Name
        values - Values
      • setNextStep

        public void setNextStep​(java.lang.String nextStep)
        Force the next step
        Parameters:
        nextStep - Next step name
      • parseTemplate

        public java.lang.String parseTemplate​(java.lang.String templateTag)
        Complete with parsed values, common tokens...
        Parameters:
        templateTag - Template tag
      • getExternalURL

        public java.lang.String getExternalURL()
        Prepare URL of external activity (Page.Name)
      • toJSON

        public java.lang.String toJSON()
      • toJSON

        public java.lang.String toJSON​(ObjectDB obj,
                                       boolean metadata)
      • toJSONObject

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

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