Class InteractiveProcessManager

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      IProcess createProcess​(java.lang.String title, java.util.List<Step> steps, IProcessCallbackHandler callbackHandler)
      Creates a portal interactive process with the given steps.
      Process getProcess​(java.lang.String processId, java.lang.String ownerId)
      Returns the process of the given identifier.
      The parameter processId is required.
      void recover​(java.lang.String processId)
      Changes the process status to "Ready".
      java.lang.String submitProcess​(IProcess process)
      Submits a process created with #createProcess(String, List).
      java.lang.String takeOwnership​(java.lang.String processId)
      Takes the ownership of the process with the given identifier.
      • Methods inherited from class java.lang.Object

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

      • InteractiveProcessManager

        public InteractiveProcessManager()
    • Method Detail

      • createProcess

        public IProcess createProcess​(java.lang.String title,
                                      java.util.List<Step> steps,
                                      IProcessCallbackHandler callbackHandler)
                               throws PortalException
        Description copied from interface: IInteractiveProcessManager
        Creates a portal interactive process with the given steps. The steps order will be kept unchanged of the one existent in the given list. The created process is not yet ready to be executed. Indeed, it is not persisted yet. After the process object is created, it must be passed to #submitProcess(Process) in order to be used. Returns the created process object.
        Specified by:
        createProcess in interface IInteractiveProcessManager
        Parameters:
        title - The process title.
        steps - The steps that compose the process.
        callbackHandler - The callback handler for the created process. May be null.
        Returns:
        the recently created process' identifier.
        Throws:
        PortalException
      • getProcess

        public Process getProcess​(java.lang.String processId,
                                  java.lang.String ownerId)
                           throws PortalException
        Description copied from interface: IInteractiveProcessManager
        Returns the process of the given identifier.
        The parameter processId is required. It represents the identifier of the process that is requested to be obtained. When it is not provided (if it is null or empty) an IllegalArgumentException is raised. If there's no process with the given identifier a PortalObjectNotFoundException will be raised.
        The parameter owner may not be null. It represents the identifier of the owner of the process. When it is not provided (if it is null or empty) an IllegalArgumentException is raised.

        If the requested process already has an owner and it is the same as the one provided, the process is returned.
        If the requested process already has an owner and it is not the same as the one provided or if the process has no owner, a ProcessNotOwnedException is raised.

        Specified by:
        getProcess in interface IInteractiveProcessManager
        Parameters:
        processId - the process identifier.
        ownerId - the owner identifier.
        Returns:
        the process.
        Throws:
        PortalObjectNotFoundException - if the requested process does not exists.
        ProcessNotOwnedException - if the given process does not belong to the given owner or if the process has no owner.
        PortalException - if other error occur.
      • takeOwnership

        public java.lang.String takeOwnership​(java.lang.String processId)
                                       throws PortalException
        Description copied from interface: IInteractiveProcessManager
        Takes the ownership of the process with the given identifier. This method will generate a new random string that will be the new owner of the given process. This method will store, also, the user of the current session as being the user that owns the process.
        Specified by:
        takeOwnership in interface IInteractiveProcessManager
        Parameters:
        processId - the process identifier.
        Returns:
        a random string that is the new process owner.
        Throws:
        PortalObjectNotFoundException - if the given process does not exist.
        PortalException - if some other error occur.
      • recover

        public void recover​(java.lang.String processId)
                     throws PortalException
        Changes the process status to "Ready". This procedure may cause an instability on the Portal and the old owner will not be able to execute it anymore until calls the IInteractiveProcessManager.takeOwnership(String).
        Parameters:
        processId - the process identifier.
        Throws:
        PortalException - if any error occurs during the process.
        Since:
        7.1.0