psdi.workflow

Class WFProcess

  • All Implemented Interfaces:
    java.rmi.Remote, MboConstants, MboRemote, MaxRemoteProxy, WFProcessRemote


    public class WFProcess
    extends Mbo
    implements WFProcessRemote
    Mbo to represent WFProcess object.

    This is a system level object.

    The key attributes for this object are ProcessName and ProcessRev.

    The attributes in this object are as follows:

    Attribute NameDescription
    Active Can this process be initiated?
    ChangeBy The user that last changed the wfprocess row. Read only.
    ChangeDate The date the wfprocess row was changed. Read only.
    Description Description of the process.
    Enabled Is the process is available to be used?
    LdKey Long description key for the DESCRIPTION field
    ObjectName Name of type of Mbo controlled by the process.
    Migrated Was this template created during the 4.1.1 upgrade?
    ProcessName Name of the process.
    ProcessRev Revision of the process.
    • Field Detail

      • AUTOINITACTIVE

        public static final java.lang.String AUTOINITACTIVE
        Bulletin Board signal to AutoInit.
        See Also:
        Constant Field Values
    • Constructor Detail

      • WFProcess

        public WFProcess(MboSet ms)
                  throws java.rmi.RemoteException
        Constructor
        Throws:
        java.rmi.RemoteException
    • Method Detail

      • init

        public void init()
                  throws MXException
        Mbo Initialization routine. Always read-only fields have their READONLY flag set here. If the process is enabled, the process is read/only and it's nodes and actions are read/only, too.
        Overrides:
        init in class Mbo
        Throws:
        MXException
      • initRelationship

        public void initRelationship(java.lang.String relationName,
                                     MboSetRemote mboSet)
                              throws MXException,
                                     java.rmi.RemoteException
        Called whenever a relationship is initialized or reset from this Mbo to another MboSet. If the process is enabled, the related mbosets of nodes and actions are also read/only.
        Overrides:
        initRelationship in class Mbo
        Parameters:
        relationName - The relationship name of the related MboSet which need to initialize.
        mboSet - The related MboSet which need to initialize.
        Throws:
        MXException
        java.rmi.RemoteException
      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Called when a new workflow process is created. An initial start node and stop node are added to the workflow process.
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • appValidate

        public void appValidate()
                         throws MXException,
                                java.rmi.RemoteException
        Called before a process is saved. If the process or any of it's dependant records have been modified, the ChangeDate and ChangeBy attributes are updated.
        Overrides:
        appValidate in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • findIncomingActions

        public java.util.List findIncomingActions(int nodeID)
                                           throws java.rmi.RemoteException,
                                                  MXException
        Returns the set of actions that point to the node with the ID given. Ignores actions extending from deleted nodes.
        Parameters:
        nodeID - The ID of the node
        Returns:
        The list of actions pointing to the node. The list may be empty.
        Throws:
        MXException
        java.rmi.RemoteException
      • getNextActionNum

        public int getNextActionNum()
                             throws MXException,
                                    java.rmi.RemoteException
        Determines the number for the next Action's ActionID.
        Returns:
        The number to use for the next Action ID.
        Throws:
        MXException
        java.rmi.RemoteException
      • setNextActionNum

        public void setNextActionNum(int actionID)
        Make sure the next actionID returned is greater than this value. This method is used when a process is copied.
        Parameters:
        actionID - The last action ID copied from the original process.
      • findNode

        public WFNode findNode(int nodeID)
                        throws MXException,
                               java.rmi.RemoteException
        Finds a node in the process, given a NodeID.
        Parameters:
        nodeID - The ID of the Node to find.
        Throws:
        MXApplicationException - Thrown with "workflow", "NotValidNode" if the NodeID isn't found in the process.
        MXException
        java.rmi.RemoteException
      • validateWorkflow

        public java.util.Vector validateWorkflow()
                                          throws MXException,
                                                 java.rmi.RemoteException
        Validates a work flow process. The Vector object returned is either null or may contain the following exceptions: MXApplicationException with "workflow", "ValNoStops", params of ProcessName & Description.
        Returns:
        A vector of MXExceptions where there are problems in the process. If the vector is null, then the process is valid.
        Throws:
        MXException
        java.rmi.RemoteException
      • validateWorkflow

        public java.util.Vector validateWorkflow(java.util.Hashtable hinfo)
                                          throws MXException,
                                                 java.rmi.RemoteException
        Validates a work flow process. The Vector object returned is either null or may contain the following exceptions: MXApplicationException with "workflow", "ValNoStops", params of ProcessName & Description.
        Parameters:
        hinfo - A hashtable of information that is passed throughout the validation process
        Returns:
        A vector of MXExceptions where there are problems in the process. If the vector is empty, then the process is valid.
        Throws:
        MXException
        java.rmi.RemoteException
      • buildSubProcessList

        public void buildSubProcessList(java.util.Hashtable h)
                                 throws java.rmi.RemoteException,
                                        MXException
        Builds a list of processes which are members of this process by recursively searching for subprocesses.
        Parameters:
        h - The list to add new processes to. ProcessName is the key and ProcessRev is the value.
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        This is called to recurse on the nodes of this process.
      • hasPositiveStop

        public boolean hasPositiveStop()
                                throws java.rmi.RemoteException,
                                       MXException
        Does this process have a positive stop?
        Returns:
        true if there is a positive stop for the process
        Throws:
        java.rmi.RemoteException
        MXException
      • hasNegativeStop

        public boolean hasNegativeStop()
                                throws java.rmi.RemoteException,
                                       MXException
        Does this process have a negative stop?
        Returns:
        true if there is a negative stop for the process
        Throws:
        java.rmi.RemoteException
        MXException
      • canDelete

        public void canDelete()
                       throws MXException,
                              java.rmi.RemoteException
        A process that's Active or Enabled may not be deleted.
        Overrides:
        canDelete in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • delete

        public void delete(long modifier)
                    throws MXException,
                           java.rmi.RemoteException
        The nodes, node detail, and action Mbo which make up a process are deleted with the process.
        Specified by:
        delete in interface MboRemote
        Overrides:
        delete in class Mbo
        Parameters:
        modifier - The bitwise flag specified to determine if certain normal security checks are to be bypassed for this delete request. For example: if the accessModifer is NOACCESSCHECK, then the check for the object's NODELETE flag and the call to the object's canDelete() method will not be performed. If the accessModifer is NONE, then all the access checks are performed before this object is marked delete.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Mbo.delete(long)
      • enableProcess

        public boolean enableProcess()
                              throws MXException,
                                     java.rmi.RemoteException
        Validates the process and sets the Enabled flag if valid. The process cannot have any unsaved changes. If method returns false, the warnings will have the information why the process isn't valid. If the process is found to be valid the Enabled attribute is set and the process saved. Also a warning is given with "workflow", "ProcessEnabled", parameters ProcessName and ProcessRev.
        Specified by:
        enableProcess in interface WFProcessRemote
        Returns:
        Returns true if the process was enabled.
        Throws:
        MXApplicationException - Thrown with "workflow", "UnsavedNoChange" if the process has unsaved changes.
        MXException
        java.rmi.RemoteException
        See Also:
        To get the error information.
      • makeProcessActive

        public void makeProcessActive()
                               throws MXException,
                                      java.rmi.RemoteException
        Make this process active. If successful, the Active flag is set and the process saved. Also a warning is given with "workflow", "ProcessActivated", parameters ProcessName and ProcessRev. Does nothing if the process is already active.
        Specified by:
        makeProcessActive in interface WFProcessRemote
        Throws:
        MXApplicationException - Thrown with "workflow", "UnsavedNoChange" if the process has unsaved changes.
        MXApplicationException - Thrown with "workflow", "CannotActivate" if the process is not enabled.
        MXApplicationException - Thrown with "workflow" and either "SubProcNeedsPosOut" or "SubProcNeedsNegOut" and parameters of the node's title, the name and revision of the process containing the subprocess node.
        MXException
        java.rmi.RemoteException
        See Also:
        WFProcess.makeProcessActive()
      • initiateWorkflow

        public WFInstanceRemote initiateWorkflow(MboRemote targetMbo,
                                                 java.lang.String memo)
                                          throws java.rmi.RemoteException,
                                                 MXApplicationException,
                                                 MXException
        Initiate this process on the target Mbo.
        Parameters:
        targetMbo - The Mbo to start workflow on.
        memo - Memo that goes with workflow start.
        Returns:
        The instance created. This instance may have actions ready immediately.
        Throws:
        MXApplicationException - Thrown with "workflow", "ProcessInactive" + the process name if the process is not active.
        MXApplicationException - Thrown with "workflow", "WrongTarget" + the process name + the process's target + target Mbo's type, if the process target doesn't match the target Mbo's type.
        java.rmi.RemoteException
        MXException
      • validateProcess

        public boolean validateProcess()
                                throws MXException,
                                       java.rmi.RemoteException
        Validates the process. If method returns false, the warnings will have the information why the process isn't valid. If successful, a warning is given with "workflow", "ProcessValidated", parameters ProcessName and ProcessRev.
        Specified by:
        validateProcess in interface WFProcessRemote
        Returns:
        Returns true if the process is valid.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        To get the error information.
      • deactivateProcess

        public void deactivateProcess()
                               throws MXException,
                                      java.rmi.RemoteException
        Deactivate this activate process. Does nothing if the process isn't active. If successful, a warning is given with "workflow", "ProcessDeactivated", parameters ProcessName and ProcessRev.
        Specified by:
        deactivateProcess in interface WFProcessRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        WFProcess.deactivateProcess()
      • createRevision

        public MboRemote createRevision()
                                 throws MXException,
                                        java.rmi.RemoteException
        Creates a new revision of the process. It copies the nodes and actions from the currently selected process revision. The new process is not-enabled and editable. If successful, a warning is given with "workflow", "CreatedRevision", parameters ProcessName and ProcessRev.
        Specified by:
        createRevision in interface WFProcessRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        WFProcess.createRevision()
      • duplicate

        public MboRemote duplicate()
                            throws MXException,
                                   java.rmi.RemoteException
        Duplicate a process and all it's subrecords. The new process is not enabled.
        Specified by:
        duplicate in interface MboRemote
        Overrides:
        duplicate in class Mbo
        Returns:
        The duplicated process.
        Throws:
        MXException
        java.rmi.RemoteException
      • getValidateOrder

        public java.lang.String[] getValidateOrder()
        Validation Order for WFProcess attributes.
        Overrides:
        getValidateOrder in class Mbo
      • save

        protected void save()
                     throws MXException,
                            java.rmi.RemoteException
        If the AutoInit flag has changed, update the reload list.
        Overrides:
        save in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • nextNoteUID

        public int nextNoteUID()
                        throws java.rmi.RemoteException,
                               MXException
        Get the next value to use for WFNotification's UniqueID.
        Throws:
        java.rmi.RemoteException
        MXException
      • updatePointedTo

        public void updatePointedTo(java.lang.Integer wasMemberNodeID,
                                    java.lang.Integer nowMemberNodeID)
                             throws java.rmi.RemoteException,
                                    MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • addNodePointedTo

        public void addNodePointedTo(Mbo pointedToNode)
                              throws java.rmi.RemoteException,
                                     MXException
        A node wants it's pointed to list. Sets the PointedTo attribute also.
        Parameters:
        pointedToNode - The node
        Throws:
        java.rmi.RemoteException
        MXException
      • createPointedToList

        public java.lang.String createPointedToList(int nodeID)
                                             throws java.rmi.RemoteException,
                                                    MXException
        Creates a list of nodes that point to the node.
        Parameters:
        nodeID - The node to create the list for
        Returns:
        The list of nodes pointing to this one, or the empty string if there aren't any.
        Throws:
        MXException
        java.rmi.RemoteException
      • getNextNodePoint

        public java.awt.Point getNextNodePoint()
                                        throws java.rmi.RemoteException,
                                               MXException
        Get where to put the next node. Used when adding nodes from the process tab.
        Returns:
        The Point with the coordinates where the next point should be.
        Throws:
        java.rmi.RemoteException
        MXException
      • getNodeAt

        public MboRemote getNodeAt(int x,
                                   int y)
                            throws java.rmi.RemoteException,
                                   MXException
        Determine if there is an undelete node at the position. Ignores deleted nodes.
        Parameters:
        x -
        y -
        Returns:
        The node if an undeleted node exists at the x,y coordinates, or null.
        Throws:
        java.rmi.RemoteException
        MXException
      • setDeletableFlag

        public void setDeletableFlag(boolean flag)
                              throws java.rmi.RemoteException,
                                     MXException
        Set the deletable flag to the value given. Does nothing if the value matches the parameter. All existing instances of this process will have their deletable flag set to the same value.
        Specified by:
        setDeletableFlag in interface WFProcessRemote
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        WFProcess.clearAutoInitiate()