psdi.workflow

Class WFAssignment

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


    public class WFAssignment
    extends Mbo
    implements WFAssignmentRemote
    Mbo to represent WFAssignment object.

    This is a system level object.

    The key attributes for this object are AssignId, ProcessName, ProcessRev, WfId and NodeId.

    The attributes in this object are as follows:

    Attribute NameDescription
    AppName of the application to launch
    AssignCodeTarget of an active assignment. Set on activation, null in template.
    AssignIDUsed to uniquely identify an assignment.
    AssignStatusThe status of the assignment: DEFAULT ACTIVE COMPLETE INACTIVE
    Assign_01 - Assign_05 Extra Fields.
    CalendarBasedFlag to indicate if the DueDate is calculated using straight time or calculated using the persons calendar.
    ConditionCondition to check to enable this assignment.
    ConditionClassName of Object to instanciate to enable conditional assignment.
    DescriptionDisplayed by inbox and applications to tell user what needs to be done
    Description_LongDescriptionLong Description for Displayed by inbox and applications to tell user what needs to be done
    DisplayOneDisplay a single complete assignment or simply complete it?
    DueDateThe date that the assignment is due according to the escalation time limit.
    EmailNotificationShould the assigned person get an email notification when the task becomes the current task of a process instance.
    EscRoleRole to use when assignment is escalated.
    HostNameURL of the MXServer. Used to create hotlinks in email messages.
    IsCustomClassIs a Custom Class used for the condition?
    LangCodeLanguage Column
    LastMemoThe last memo written on the workflow instance.
    NodeIDThe task node that this assignment is related to.
    ObjectNameType of Object the process, that owns this assignment, supports.
    OrigPersonThe original person for the assignment before any delegation is applied
    OwnerDescriptionDescriptive text about MBO referenced by the assignment.
    OwnerIDUnique key of the MAXIMO Object associated with this workflow.
    OwnerTableTable of the MAXIMO Object associated with this workflow.
    PriorityPriority of this assignment
    ProcessNameName of the process that this assignment is related to.
    ProcessRev The Process revision number this assignment is related to.
    RoleID identifier which describes the target of this assignment.
    StartDateThe DATETIME that the assignment became current. It is set to the current date/time on the server. This value is NULL for process definitions
    TemplateIDIdentifies the Communication Template to use to email assignees. If null, no email is sent.
    TimeLimitThis is the time in hours that can pass before the task is escalated. Defaults from the task time limit but can be changed.
    UserSqlUser Entered Expression - used to link to the expression builder.
    WFAssignmentIDUnique Identifier
    WfIdThe workflow identifier of the WFInstance that this assignment is related to.
    • Constructor Detail

      • WFAssignment

        public WFAssignment(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.
        Overrides:
        init in class Mbo
        Throws:
        MXException
      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Called when a new workflow assignment is created. During design time, the set is ultimately owned by a WFProcess. Assignments created during run time are ultimately owned by a WFInstance.
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • complete

        public void complete(java.lang.String memo)
                      throws java.rmi.RemoteException,
                             MXException
        Change the assignment's status to complete and write a transaction.
        Parameters:
        memo - Assignment completion memo.
        Throws:
        java.rmi.RemoteException
        MXException
      • inactivate

        public void inactivate()
                        throws java.rmi.RemoteException,
                               MXException
        Change the assignment's status to inactive.
        Throws:
        java.rmi.RemoteException
        MXException
      • cancel

        public void cancel(java.lang.String memo)
                    throws java.rmi.RemoteException,
                           MXException
        Change the assignment's status to cancel and write a transaction.
        Throws:
        java.rmi.RemoteException
        MXException
      • escalate

        public void escalate()
                      throws MXException,
                             java.rmi.RemoteException
        Change the assignment's status to escalated and write a transaction.
        Throws:
        MXException
        java.rmi.RemoteException
      • calcDueDate

        public java.util.Date calcDueDate(PersonRemote person,
                                          java.util.Date startDate)
                                   throws java.rmi.RemoteException,
                                          MXException
        Calculate the due date. If CALENDARBASED flag = true add timelimit to startdate based on the persons calendar to get the due date. If CALENDARBASED flag = false (or persons workperiods could not accomodate timelimit) add timelimit to startdate to get the due date.
        Throws:
        java.rmi.RemoteException
        MXException
      • isActive

        public boolean isActive()
                         throws java.rmi.RemoteException,
                                MXException
        Is this assignment active?
        Specified by:
        isActive in interface WFAssignmentRemote
        Returns:
        Returns true if the assignment's status is "active". If the Mbo is marked for deletion, then false is always returned.
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        WFAssignment.isActive()
      • wfValidate

        public void wfValidate(java.util.Vector errs)
                        throws MXException,
                               java.rmi.RemoteException
        Validate the assignment record. Checks the conditionals.
        Parameters:
        errs - The error list to add to.
        Throws:
        MXException
        java.rmi.RemoteException
      • getTask

        public WFTask getTask()
                       throws java.rmi.RemoteException,
                              MXException
        Get the task details of the node owner of the assignment.
        Throws:
        java.rmi.RemoteException
        MXException
      • getInstance

        public WFInstance getInstance()
                               throws MXException,
                                      java.rmi.RemoteException
        Returns a reference to the instance that this assignment is a part of. Note that the instance will not be linked to the assignment.
        Returns:
        A reference to the instance
        Throws:
        MXException
        java.rmi.RemoteException
      • getNode

        public WFNodeRemote getNode()
                             throws MXException,
                                    java.rmi.RemoteException
        Gets task node which owns the assignment.
        Throws:
        MXException
        java.rmi.RemoteException
      • evaluateAssignmentCondition

        public boolean evaluateAssignmentCondition()
                                            throws MXException,
                                                   java.rmi.RemoteException
        Evaluate the condition associated with the assignment. This determines whether a template assignment generates active assignments. If there is no condition, true is returned.
        Returns:
        true if the template should generate active assignments.
        Throws:
        MXException
        java.rmi.RemoteException
      • generateAssignments

        public void generateAssignments()
                                 throws java.rmi.RemoteException,
                                        MXException
        Generate active assignments for this template assignment. Active assignments are added to the owning Task's activeAssignments set.
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        This is the owning Task's activeAssignments set.
      • sendNotification

        public void sendNotification(PersonRemote person)
                              throws java.rmi.RemoteException,
                                     MXException
        Send notification of the new assignment.
        Parameters:
        person - The person assigned.
        Throws:
        java.rmi.RemoteException
        MXException
      • escalate

        public void escalate(java.lang.String memo)
                      throws MXException,
                             java.rmi.RemoteException
        Do the "basic" escalation of this assignment. Creates a new assignment template using the EscRole for the RoleID. That template assignment is used to generate assignments. The original assignment's status is changed to 'ESCALATED'.

        Note that if you fetch an assignment, change it, and call escalate your changes will not be reflected in the assignment escalated because we need to fetch the assignment from the instance in order to generate assignments correctly.

        Specified by:
        escalate in interface WFAssignmentRemote
        Parameters:
        memo - Memo for the transaction.
        Throws:
        MXApplicationException - throw with "workflow", "NoEscalate" if there no role to escalate to.
        MXException
        java.rmi.RemoteException
        See Also:
        WFAssignment.escalate(String)
      • skipCopyField

        protected boolean skipCopyField(MboValueInfo mvi)
                                 throws java.rmi.RemoteException,
                                        MXException
        The method returns true if the field given should not be copied when a copy is made of the Mbo. Fields ProcessName & ProcessRev are not copied, as well as nonpersistent attributes ObjectName, DisplayOne, UserSQL & OwnerDescription.
        Overrides:
        skipCopyField in class Mbo
        Throws:
        java.rmi.RemoteException
        MXException
      • getMboSet

        public MboSetRemote getMboSet(java.lang.String name)
                               throws MXException,
                                      java.rmi.RemoteException
        Overridden to support faux MboSet OWNER.
        Specified by:
        getMboSet in interface MboRemote
        Overrides:
        getMboSet in class Mbo
        Parameters:
        name - The relationship provided to retrieve a related mboSet, usually using foreign keys. For example, "psdi.app.workorder.WOSetRemote.ASSET" is a relationship for the work order object to access the asset Set where "workorder.assetnum=asset.assetnum". The relationship can also be chained. Such as ASSET.ASSETSTATUS.
        Returns:
        The returned related set specified through the relationship.
        Throws:
        MXException - "A relationship called {0} does not exist for the {1} business object" exception will be thrown if the relationship was not found. "Unknown Object" exception will be thrown if the database object can not be found through the relationship.
        java.rmi.RemoteException
        See Also:
        Mbo.getMboSet(String)
      • setOriginalPersonForAssignment

        protected void setOriginalPersonForAssignment(PersonRemote originalPersonForAssignment)
      • getOriginalPersonForAssignment

        public PersonRemote getOriginalPersonForAssignment()
      • foundPersonToAssignForRole

        public boolean foundPersonToAssignForRole()
                                           throws MXException,
                                                  java.rmi.RemoteException
        12-13113/IV21649: indicates if the assignment(template) has found a person for its role.
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException