Class WorkflowDesignerSessionController

    • Constructor Detail

      • WorkflowDesignerSessionController

        public WorkflowDesignerSessionController​(MainSessionController mainSessionCtrl,
                                                 ComponentContext componentContext)
        Standard Session Controller Constructeur
        Parameters:
        mainSessionCtrl - The user's profile
        componentContext - The component's profile
    • Method Detail

      • loadProcessModel

        public ProcessModel loadProcessModel​(String strProcessFileName)
                                      throws WorkflowDesignerException
        Load the process model from the specified file, cache it before returning.
        Parameters:
        strProcessFileName - relative path and the file name
        Returns:
        An object implementing the ProcessModel interface
        Throws:
        WorkflowDesignerException
      • removeProcessModel

        public void removeProcessModel​(String strProcessModelFileName)
                                throws WorkflowDesignerException
        Removes the process model descriptor file from the filesystem
        Parameters:
        strProcessModelFileName - the relative path to the process file name
        Throws:
        WorkflowDesignerException - when something goes wrong
      • getProcessModel

        public ProcessModel getProcessModel()
        An object implementing the ProcessModel interface containing the currently loaded model or null if none.
      • isNewProcessModel

        public Boolean isNewProcessModel()
        Is it a new Process Model that has not yet been saved to a file?
      • getProcessFileName

        public String getProcessFileName()
        The relative path and file name of the currently loaded model or null if none.
      • getComponentDescriptorName

        public String getComponentDescriptorName()
        The name of the component descriptor that references this process model definition
        Returns:
        the component descriptor file name (without .xml) or null if no components reference this process model.
      • updateProcessModelHeader

        public void updateProcessModelHeader​(ProcessModel processModel)
        Update the header of the cached process model
        Parameters:
        processModel - the reference object
      • addColumns

        public Columns addColumns()
        Create a new columns object to be added to the model
        Returns:
        an object implementing Columns
      • createRole

        public Role createRole()
        Create a new role object to be added to the model
        Returns:
        an object implementing Role
      • updateRole

        public void updateRole​(Role source,
                               String strNameOriginal)
                        throws WorkflowDesignerException
        Update or insert a new role element of the cached process model
        Parameters:
        source - the data carrier object
        strNameOriginal - the original name of the object
        Throws:
        WorkflowDesignerException - if another object with the same name already exists
      • createParticipant

        public Participant createParticipant()
        Create a new participant object to be added to the model
        Returns:
        an object implementing Participant
      • removeParticipant

        public void removeParticipant​(String strParticipantName)
                               throws WorkflowDesignerException
        Remove the participant specified
        Parameters:
        strParticipantName - the name of the participant
        Throws:
        WorkflowDesignerException - if the participant cannot be found or is referenced elsewhere.
      • createState

        public State createState()
        Create a new state object to be added to the model
        Returns:
        an object implementing State
      • findRelatedUser

        public RelatedUser findRelatedUser​(String strContext,
                                           String strParticipant,
                                           String strFolderItem,
                                           String strRelation,
                                           String strRole)
                                    throws WorkflowException
        Find a related user corresponding to the criteria given
        Parameters:
        strContext - the context
        strParticipant - the name of the participant, may be null
        strFolderItem - the name of the data folder item, may be null
        strRelation - the relation, may be null
        strRole - the name of the role, may be null
        Returns:
        an object implementing RelatedUser
        Throws:
        WorkflowException - when something goes wrong
      • updateRelatedUser

        public void updateRelatedUser​(RelatedUser source,
                                      String strContext,
                                      String strParticipantOriginal,
                                      String strFolderItemOriginal,
                                      String strRelationOriginal,
                                      String strRoleOriginal)
                               throws WorkflowDesignerException,
                                      WorkflowException
        Update a related user corresponding to the criteria given
        Parameters:
        strContext - the context
        strParticipantOriginal - the original name of the participant, may be null
        strFolderItemOriginal - the original name of the data folder item, may be null
        strRelationOriginal - the original relation, may be null
        strRoleOriginal - the original name of the role, may be null
        Throws:
        WorkflowDesignerException - when something goes wrong
        WorkflowException - when something goes wrong
      • removeRelatedUser

        public void removeRelatedUser​(RelatedUser reference,
                                      String strContext)
                               throws WorkflowException
        Remove the related user specified
        Parameters:
        reference - the reference for the related user to remove
        strContext - the context
        Throws:
        WorkflowException - if the related user cannot be found or when something goes wrong
      • createAction

        public Action createAction()
        Create a new action object to be added to the model
        Returns:
        an object implementing Action
      • moveConsequence

        public void moveConsequence​(String strContext,
                                    int iConsequence,
                                    int nDirection)
                             throws WorkflowDesignerException
        Move the consequence specified by the context inside the collection
        Parameters:
        strContext - the context of the consequence
        iConsequence - the current index of the consequence in the collection
        nDirection - the offset and the direction to move by
        Throws:
        WorkflowDesignerException - if the consequence cannot be found.
      • removeConsequence

        public void removeConsequence​(String strContext)
                               throws WorkflowDesignerException
        Remove the consequence specified by the context
        Parameters:
        strContext - the context of the consequence
        Throws:
        WorkflowDesignerException - if the consequence cannot be found.
      • createForm

        public Form createForm()
        Create a new form object to be added to the model
        Returns:
        an object implementing Form
      • findForm

        public Form findForm​(String strContext)
        Find the form by context
        Parameters:
        strContext - the context
        Returns:
        a Form object
      • updateForm

        public void updateForm​(Form source,
                               String strContext,
                               String strNameOriginal,
                               String strRoleOriginal)
                        throws WorkflowDesignerException
        Update Form referenced by the context.
        Parameters:
        source - the object carrying the new values
        strContext - the context of the form being updated
        strNameOriginal - the original name of the form
        Throws:
        WorkflowDesignerException - when the update goes wrong
      • findInput

        public Input findInput​(String strContext)
        Find the input by context
        Parameters:
        strContext - the context
        Returns:
        a Input object
      • updateInput

        public void updateInput​(Input source,
                                String strContext)
                         throws WorkflowDesignerException
        Update or insert a new input element of the cached process model
        Parameters:
        source - the reference object
        strContext - the context of Input
        Throws:
        WorkflowDesignerException - when something goes wrong
      • createDesignation

        public ContextualDesignation createDesignation()
        Create a new ContextualDesignation object to be added to the model
        Returns:
        an object implementing ContextualDesignation
      • findContextualDesignation

        public ContextualDesignation findContextualDesignation​(String strContext,
                                                               String strRole,
                                                               String strLanguage)
                                                        throws WorkflowDesignerException
        Finds the contextual designation with the given attributes in the specified context
        Parameters:
        strContext - the context of the designation
        strLanguage - the language
        strRole - the role name
        Returns:
        contextual designation of the given role & name or null
        Throws:
        WorkflowDesignerException - if something goes wrong
      • removeContextualDesignation

        public void removeContextualDesignation​(String strContext,
                                                ContextualDesignation contextualDesignation)
                                         throws WorkflowDesignerException
        Removes the contextual designation with the attributes as the reference object in the specified context
        Parameters:
        strContext - the context of the designation
        contextualDesignation - the reference object
        Throws:
        WorkflowDesignerException - when something goes wrong e.g. designation not found
      • createItem

        public Item createItem​(String strContext)
        Create a new item object to be added to the model
        Returns:
        an object implementing Item
      • findItem

        public Item findItem​(String strContext)
        Find the Item specified by the context
        Parameters:
        strContext - the context
        Returns:
        an Item object or null
      • updateItem

        public void updateItem​(Item source,
                               String strContext,
                               String strNameOriginal)
                        throws WorkflowDesignerException
        Update Item referenced by the context.
        Parameters:
        source - the object carrying the new values
        strContext - the context of the item being updated
        strNameOriginal - the original name of the item
        Throws:
        WorkflowDesignerException - when the update goes wrong
      • updateParameter

        public void updateParameter​(Parameter source,
                                    String strContext,
                                    String strNameOriginal)
                             throws WorkflowDesignerException
        Update Parameter referenced by the context and parameter name.
        Parameters:
        source - the object carrying the new values
        strContext - the context of the item being updated
        strNameOriginal - the original name of the parameter
        Throws:
        WorkflowDesignerException - when the update goes wrong
      • removeParameter

        public void removeParameter​(String strContext,
                                    String strName)
                             throws WorkflowException
        Remove the parameter described by the context and name
        Parameters:
        strContext - the context
        strName - the name of the parameter
        Throws:
        WorkflowException
      • retrieveLanguageCodes

        public String[] retrieveLanguageCodes​(boolean fDefault)
        Returns the language codes as configured in the properties
        Parameters:
        fDefault - if true the 'default' option shall be included
        Returns:
        an array of language codes
      • retrieveLanguageNames

        public String[] retrieveLanguageNames​(boolean fDefault)
        Returns names of available languages as configured in the properties, localised for the current user
        Parameters:
        fDefault - if true the 'default' option shall be included
        Returns:
        an array of language names
      • retrieveItemTypeCodes

        public String[] retrieveItemTypeCodes​(boolean fNone)
        Returns the item type codes as configured in the properties
        Parameters:
        fNone - if true the 'None' option shall be included
        Returns:
        an array of codes
      • retrieveOperators

        public String[] retrieveOperators​(boolean fNone)
        Returns a list of comparison operators as configured in the properties,
        Parameters:
        fNone - if true the 'none' option shall be included
        Returns:
        an array of operators
      • retrieveActionKindCodes

        public String[] retrieveActionKindCodes()
        Returns the action kind codes as configured in the properties retrieve
        Returns:
        an array of codes
      • retrieveActionNames

        public String[] retrieveActionNames​(boolean fNone)
        Produce a list of action names
        Parameters:
        fNone - if true the 'None' option shall be included
        Returns:
        an array of Strings or an empty array.
      • retrieveRoleNames

        public String[] retrieveRoleNames​(boolean fNone,
                                          boolean fDefault)
        Produce a list of role names
        Parameters:
        fNone - if true the 'None' option shall be included
        fDefault - if true the 'default' option shall be included
        Returns:
        an array of Strings or an empty array.
      • retrieveStateNames

        public String[] retrieveStateNames​(boolean fNone)
        Produce a list of state names
        Parameters:
        fNone - if true the 'None' option shall be included
        Returns:
        an array of Strings or an empty array.
      • retrieveParticipantNames

        public String[] retrieveParticipantNames​(boolean fNone)
        Produce a list of participant names
        Parameters:
        fNone - if true the 'None' option shall be included
        Returns:
        an array of Strings or an empty array.
      • retrieveUserInfoItemNames

        public String[] retrieveUserInfoItemNames​(boolean fNone,
                                                  boolean fUsersOnly)
        Produce a list of user info item names, optionally those where the type = 'user'
        Parameters:
        fNone - if true the 'None' option shall be included
        fUsersOnly - if true only the items of type 'user' shall be included
        Returns:
        an array of Strings or an empty array.
      • retrieveFolderItemNames

        public String[] retrieveFolderItemNames​(boolean fNone,
                                                boolean fUsersOnly)
        Produce a list of data folder item names, optionally those where the type = 'user'
        Parameters:
        fNone - if true the 'None' option shall be included
        fUsersOnly - if true only the items of type 'user' shall be included
        Returns:
        an array of Strings or an empty array.
      • retrieveFolderItems

        public List<Item> retrieveFolderItems()
      • retrieveFormNames

        public String[] retrieveFormNames​(boolean fNone)
        Produce a list of form names, only forms other than 'presentationForm' and 'printForm'
        Parameters:
        fNone - if true the 'None' option shall be included
        Returns:
        an array of Strings or an empty array.
      • generateComponentDescriptor

        public void generateComponentDescriptor()
                                         throws WorkflowDesignerException
        Generates component descriptor file in the appropriate directory, stores the new descriptor's name to be able to access it later
        Throws:
        WorkflowDesignerException - when something goes wrong
      • clearCache

        public void clearCache()
      • replaceSpecialChars

        public static String replaceSpecialChars​(String toParse)