Class MWFActivity

    • Constructor Detail

      • MWFActivity

        public MWFActivity​(Properties ctx,
                           int AD_WF_Activity_ID,
                           String trxName)
        Standard Constructor
        Parameters:
        ctx - context
        AD_WF_Activity_ID - id
        trxName - transaction
      • MWFActivity

        public MWFActivity​(Properties ctx,
                           ResultSet rs,
                           String trxName)
        Load Constructor
        Parameters:
        ctx - context
        rs - result set
        trxName - transaction
      • MWFActivity

        public MWFActivity​(MWFProcess process,
                           int AD_WF_Node_ID)
        Parent Contructor
        Parameters:
        process - process
        AD_WF_Node_ID - start node
      • MWFActivity

        public MWFActivity​(MWFProcess process,
                           Properties ctx,
                           ResultSet rs,
                           String trxName)
        Process-aware Parent Constructor
        Parameters:
        process - process
        ctx - context
        rs - record to load
        trxName - transaction name
      • MWFActivity

        public MWFActivity​(MWFProcess process,
                           int next_ID,
                           PO lastPO)
        Parent Constructor
        Parameters:
        process - process
        next_ID - start node
        lastPO - PO from the previously executed node
    • Method Detail

      • get

        public static MWFActivity[] get​(Properties ctx,
                                        int AD_Table_ID,
                                        int Record_ID,
                                        boolean activeOnly)
        Get Activities for table/record
        Parameters:
        ctx - context
        AD_Table_ID - table
        Record_ID - record
        activeOnly - if true only not processed records are returned
        Returns:
        activity
      • getActiveInfo

        public static String getActiveInfo​(Properties ctx,
                                           int AD_Table_ID,
                                           int Record_ID)
        Get Active Info
        Parameters:
        ctx - context
        AD_Table_ID - table
        Record_ID - record
        Returns:
        activity summary
      • getState

        public StateEngine getState()
        Get State
        Returns:
        state
      • isClosed

        public boolean isClosed()
        Is Activity closed
        Returns:
        true if closed
      • getEventAudit

        public MWFEventAudit getEventAudit()
        Get/Create Event Audit
        Returns:
        event
      • getPO

        public PO getPO​(Trx trx)
        Get Persistent Object in Transaction
        Parameters:
        trx - transaction
        Returns:
        po
      • getPO

        public PO getPO()
        Get Persistent Object
        Returns:
        po
      • getPO_AD_Client_ID

        public int getPO_AD_Client_ID()
        Get PO AD_Client_ID
        Returns:
        client of PO
      • getAttributeValue

        public Object getAttributeValue()
        Get Attribute Value (based on Node) of PO
        Returns:
        Attribute Value or null
      • isSOTrx

        public boolean isSOTrx()
        Is SO Trx
        Returns:
        SO Trx or of not found true
      • getNode

        public MWFNode getNode()
        Get WF Node
        Returns:
        node
      • getNodeName

        public String getNodeName()
        Get WF Node Name
        Returns:
        translated node name
      • getNodeDescription

        public String getNodeDescription()
        Get Node Description
        Returns:
        translated node description
      • getNodeHelp

        public String getNodeHelp()
        Get Node Help
        Returns:
        translated node help
      • isUserApproval

        public boolean isUserApproval()
        Is this an user Approval step?
        Returns:
        true if User Approval
      • isUserManual

        public boolean isUserManual()
        Is this a Manual user step?
        Returns:
        true if Window/Form/..
      • isUserChoice

        public boolean isUserChoice()
        Is this a user choice step?
        Returns:
        true if User Choice
      • addTextMsg

        public void addTextMsg​(Object obj)
        Add to Text Msg
        Parameters:
        obj - some object
      • getWFStateText

        public String getWFStateText()
        Get WF State text
        Returns:
        state text
      • getResponsible

        public MWFResponsible getResponsible()
        Get Responsible
        Returns:
        responsible
      • isInvoker

        public boolean isInvoker()
        Is Invoker (no user and no role)
        Returns:
        true if invoker
      • getApprovalUser

        public int getApprovalUser​(int AD_User_ID,
                                   int C_Currency_ID,
                                   BigDecimal amount,
                                   int AD_Org_ID,
                                   boolean ownDocument)
        Get Approval User. If the returned user is the same, the document is approved.
        Parameters:
        AD_User_ID - starting User
        C_Currency_ID - currency
        amount - amount
        AD_Org_ID - document organization
        ownDocument - the document is owned by AD_User_ID
        Returns:
        AD_User_ID - if -1 no Approver
      • run

        public void run()
        Execute Work. Called from MWFProcess.startNext Feedback to Process via setWFState -> checkActivities
        Specified by:
        run in interface Runnable
      • setUserChoice

        public boolean setUserChoice​(int AD_User_ID,
                                     String value,
                                     int displayType,
                                     String textMsg)
                              throws Exception
        Set User Choice
        Parameters:
        AD_User_ID - user
        value - new Value
        displayType - display type
        textMsg - optional Message
        Returns:
        true if set
        Throws:
        Exception - if error
      • forwardTo

        public boolean forwardTo​(int AD_User_ID,
                                 String textMsg)
        Forward To
        Parameters:
        AD_User_ID - user
        textMsg - text message
        Returns:
        true if forwarded
      • setUserConfirmation

        public void setUserConfirmation​(int AD_User_ID,
                                        String textMsg)
        Set User Confirmation
        Parameters:
        AD_User_ID - user
        textMsg - optional message
      • getHistoryHTML

        public String getHistoryHTML()
        Get Process Activity (Event) History
        Returns:
        history
      • isPdfAttachment

        public boolean isPdfAttachment()
        Does the underlying PO (!) object have a PDF Attachment
        Overrides:
        isPdfAttachment in class PO
        Returns:
        true if there is a pdf attachment
      • getPdfAttachment

        public byte[] getPdfAttachment()
        Get PDF Attachment of underlying PO (!) object
        Overrides:
        getPdfAttachment in class PO
        Returns:
        pdf data or null
      • toStringX

        public String toStringX()
        User String Representation. Suspended: Approve it (Joe)
        Returns:
        info
      • getSummary

        public String getSummary()
        Get Document Summary
        Returns:
        PO Summary