Interface SessionContext

  • All Superinterfaces:
    UserAttributeContainer

    public interface SessionContext
    extends UserAttributeContainer
    The session context provides the component with services and information that is important for their execution. All methods of this interface may only be called by the main thread executing a component.
    Author:
    Markus Lauer, Ulrich Kreher
    • Method Detail

      • getSessionID

        String getSessionID()
        Returns the the session id that makes possible to identify the application instance the session context belongs to.
        Returns:
        the session ID
      • getEBPInstanceReference

        EBPInstanceReference getEBPInstanceReference()
        Returns the reference to the corresponding process step which contains all information to identify the process step. You should not need to use this information at all since executed components will be reusable the most if they do not depend on any process context.
        Returns:
        The reference containing all information for identifying the corresponding process step of this component execution.
      • getDataContext

        DataContext getDataContext()
        Gets the data context, that is, an interface to get and set the values of all input and output parameters of an application.
        Returns:
        The data context containing the values of the input parameters and providing the means to set the values of the output parameters.
      • getGUIContext

        GUIContext getGUIContext()
        Gets the GUI context which contains the parent GUI for the application. The returned context is of the appropriate type for the application as specified in the corresponding configuration of the ADEPT2-client.
        Returns:
        The graphical context for the user interface of an application.
      • getRuntimeEnvironment

        RuntimeEnvironment getRuntimeEnvironment()
        Returns a reference to the appropriate RuntimeEnvironment.
        Returns:
        the reference to the RuntimeEnvironment.
      • getProgressMonitor

        ProgressMonitor getProgressMonitor()
        Returns the assigned progress monitor which should be notified about the progress of the run. The progress state may be analysed by the system to estimate the readiness of the application for its termination, for example.
        Returns:
        the progress monitor
      • getClientSessionFactory

        ClientSessionFactory getClientSessionFactory()
        Returns the client session factory which allows to retrieve the executing agent as well as session tokens which are needed to access ADEPT2-interface-methods.
        Returns:
        The client session factory to be used by the executed component.
      • isTestMode

        boolean isTestMode()
        Enables the component to inform itself if it is executed in the test mode. This method returns true, if the ExecutionManager told the RuntimeManager via the ExecutionContext at activity start to execute the activity, i. e. the component, in the ExecutionMode.COMPONENT_TEST mode.

        isTestMode() and isViewOnly() are mutual exclusive just one of this flag is set if any.

        Returns:
        TRUE: Test mode is turned on FALSE: the component is executed in a production environment
        See Also:
        ExecutionContext, ProcessConstants.ExecutionMode
      • isViewOnly

        boolean isViewOnly()
        Instructs the component to use the view only mode, that is, the values of the input and output parameters are just displayed but can not be changed. In case of the view only mode getDataContext() returns a read-only data context which allows to retrieve the values of output parameters.

        isTestMode() and isViewOnly() are mutual exclusive just one of this flag is set if any. But isViewOnly() can be mixed together with getCurrentEnquiry() and/or getRepliedEnquiry() which means that there is an enquiry or a reply for the execution but the component has already been completely finished.

        Returns:
        Whether the component should run in view only mode.
        See Also:
        ProcessConstants.ExecutionMode
      • getCurrentEnquiry

        Enquiry getCurrentEnquiry()
        Gets the current enquiry that was caused when executing this component. The current execution of the component (using this session context) is done in enquiry mode, that means, the current agent should not finish this activity but merely reply to the enquiry and sent the answer back.

        If the activity is not executed as enquiry, the returned Enquiry will be null. The reply will obviously always be null since it has not been replied to yet.

        Important: In case there is an enquiry for the current execution the component should not allow to close it but just to suspend it. Otherwise the agent sending the enquiry will only receive the reply but without the data the activity! Please note that the enquiry mode can be mixed together with isViewOnly(), this means, the component is executed in view-only mode and has an open enquiry that needs to be replied.

        Returns:
        The enquiry set for assistance by the current agent or null if there is no enquiry for the current execution.
        See Also:
        ExecutionContext.getCurrentEnquiry()
      • getRepliedEnquiry

        Enquiry getRepliedEnquiry()
        Gets the replied enquiry in case the activity has been made an enquiry for (by the current user for execution of the current component) and this has been replied now. The reply of the enquiry recipient is contained in the returned enquiry. This enquiry has been set in a previous execution and has been replied by the enquiry receiver.

        If the activity has not been made an enquiry for, the returned Enquiry will be null.

        Unlike getCurrentEnquiry() this enquiry is reply to a previous enquiry. If there is no current enquiry (getCurrentEnquiry() returns null), the application can be closed. Please note that the replied enquiry mode can be mixed together with isViewOnly(), this means, the component is executed in view-only mode and has a reply for an enquiry.

        Returns:
        The enquiry set by the current agent needing assistance in the previous execution of the activity or null.
        See Also:
        ExecutionContext.getRepliedEnquiry()