psdi.workflow

Class WorkflowDirector

  • java.lang.Object
    • psdi.workflow.WorkflowDirector


  • public class WorkflowDirector
    extends java.lang.Object
    This class handles the Workflow - User Interface relations
    • Constructor Detail

      • WorkflowDirector

        public WorkflowDirector(MXSession s)
        Constructor
        Parameters:
        s - Used to create MboSets when needed.
    • Method Detail

      • isInteractionDoublePlay

        public boolean isInteractionDoublePlay()
        Determines if the interaction has an Action asscociated with it
        Returns:
        Does the interation have an action as well?
      • isInteractionRelation

        public boolean isInteractionRelation()
        Determines if the interaction creates related records
        Returns:
        Does the interation have an action as well?
      • getInstance

        public WFInstanceRemote getInstance()
        Returns the current workflow instance
        Returns:
        The current instance.
      • getAssignment

        public WFAssignmentRemote getAssignment()
        Get the current workflow assignment.
        Returns:
        The assignment or null if none.
      • getNextApp

        public java.lang.String getNextApp()
        Get the next application to bring up.
        Returns:
        The application name or null.
      • getNextAction

        public java.lang.String getNextAction()
        Get the next page to display. If null, the director doesn't have anything more to do for the user interface.
        Returns:
        The next page to go to or null.
      • getWfSet

        public MboSetRemote getWfSet()
        Get the set to use with a workflow based parameter set - InitiateWorkflow, CompleteAssignment, ...
        Returns:
        The workflow set.
      • setAssignment

        public void setAssignment(WFAssignmentRemote remote)
        Set the current workflow assignment.
        Parameters:
        remote -
      • setInstance

        public void setInstance(WFInstanceRemote remote)
        Set the current workflow instance.
        Parameters:
        remote -
      • setNextApp

        protected void setNextApp(java.lang.String string)
        Set the next application.
        Parameters:
        string -
      • setNextAction

        protected void setNextAction(java.lang.String string)
        Set the next page.
        Parameters:
        string -
      • setWfSet

        protected void setWfSet(MboSetRemote remote)
        Set the workflow set.
        Parameters:
        remote -
      • getNextDirectionBody

        public java.lang.String getNextDirectionBody()
        Returns the body text for the directions dialog
      • getNextDirectionTitle

        public java.lang.String getNextDirectionTitle()
        Returns the title for the directions dialog
      • clearDirections

        public void clearDirections()
        Clear the directions.
      • input

        public void input(DirectorInput message)
                   throws MXException,
                          java.rmi.RemoteException
        Respond to a UI thing
        Parameters:
        message - The name of the action.
        Throws:
        MXException
        java.rmi.RemoteException
      • reset

        public void reset()
                   throws java.rmi.RemoteException,
                          MXException
        Reset the workflow director
        Throws:
        java.rmi.RemoteException
        MXException
      • resetNonUI

        public void resetNonUI()
                        throws java.rmi.RemoteException,
                               MXException
        Reset the WorkflowDirector but preserve the UI state (NextApp, NextAction and NextTab) Typically call this method when the workflow is completed but there is an interaction node that needs to be invoked before the stopping the workflow.
        Throws:
        java.rmi.RemoteException
        MXException
      • getControlled

        public MboRemote getControlled()
        Get the Mbo under workflow control.
        Returns:
        The controlled Mbo.
      • setControlled

        public void setControlled(MboRemote remote)
        Set the Mbo controlled by the current workflow instance.
        Parameters:
        remote - The Mbo.
      • getControlledUniqueKey

        public long getControlledUniqueKey()
                                    throws java.rmi.RemoteException,
                                           MXException
        Returns the unique key of Mbo controlled by workflow.
        Returns:
        The unique key or -1 if no object is controlled by workflow
        Throws:
        java.rmi.RemoteException
        MXException
      • startInput

        public void startInput(java.lang.String app,
                               MboRemote target,
                               DirectorInput message)
                        throws MXException,
                               java.rmi.RemoteException
        Respond to a start of a UI thing. This combines one of the setControlled/Instance/Assignment calls with an input. Only used when a button is clicked to start an interaction between the UI and Workflow.
        Parameters:
        target - The target.
        message - What the start is about.
        Throws:
        MXException
        java.rmi.RemoteException
      • clearRelationship

        protected void clearRelationship()
        Clear out the relationship stuff
      • getNextUniqueId

        public long getNextUniqueId()
        Used when setRelationship is used - returns the unique id of the related record.
        Returns:
        The Unique ID of the record or -1 if should stay with the current record.
      • getWorkflowWarnings

        public MXException[] getWorkflowWarnings()
        Gives all the warnings from the list - this will empty the list of warnings.
      • addWorkflowWarning

        public void addWorkflowWarning(MXException exception)
        Add the exception to the list of warnings.
        Parameters:
        exception - The exception to add.
      • isAtInteraction

        public boolean isAtInteraction()
        Is the director pausing at an interaction?
      • getNextTab

        public java.lang.String getNextTab()
        Get the next tab.
        Returns:
        Returns the nextTab or null.
      • setNextTab

        public void setNextTab(java.lang.String nextTab)
        Set the next tab to go to
        Parameters:
        nextTab - The nextTab to set.
      • getLaunchProcess

        public java.lang.String getLaunchProcess()
        Get the process to launch after a Mbo hop
        Returns:
        Returns the launchProcess.
      • setLaunchProcess

        public void setLaunchProcess(java.lang.String launchProcess)
        Set the process to launch after a Mbo hop.
        Parameters:
        launchProcess - The launchProcess to set.
      • setAssignID

        public void setAssignID(int assignID)
        Give the ID of the assignment - use for launching from the Inbox.
        Parameters:
        assignID -
      • setProcessName

        public void setProcessName(java.lang.String valueString)
        Tell the director which process to initiate or complete assignments for.
        Parameters:
        valueString - Name of the process.
      • doAutoInit

        public boolean doAutoInit(MboRemote targetMbo)
                           throws java.rmi.RemoteException,
                                  MXException
        Called when the current record of an application is saved, initiates workflow if there's a process set up to auto-initiate for the Mbo type.
        Parameters:
        mbo - The current Mbo.
        Returns:
        True if workflow was started
        Throws:
        java.rmi.RemoteException
        MXException
      • preventAutoInit

        public void preventAutoInit()
        This tells the director to not auto-initiate workflow at the next call. Used when a route button is clicked directly.
      • allowAutoInit

        public void allowAutoInit()
        Reset AutoInit
      • clearInteraction

        public void clearInteraction()
        Clears interaction directions when they are no longer needed.