Adempiere 3.5.2a

org.compiere.wf
Class MWFActivity

java.lang.Object
  extended by org.compiere.model.PO
      extended by org.compiere.model.X_AD_WF_Activity
          extended by org.compiere.wf.MWFActivity
All Implemented Interfaces:
Serializable, Runnable, Comparator, I_AD_WF_Activity, I_Persistent, Evaluatee

public class MWFActivity
extends X_AD_WF_Activity
implements Runnable

Workflow Activity Model. Controlled by WF Process: set Node - startWork

Version:
$Id: MWFActivity.java,v 1.4 2006/07/30 00:51:05 jjanke Exp $
Author:
Jorg Janke
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.compiere.model.X_AD_WF_Activity
AD_USER_ID_AD_Reference_ID, WFSTATE_Aborted, WFSTATE_AD_Reference_ID, WFSTATE_Completed, WFSTATE_NotStarted, WFSTATE_Running, WFSTATE_Suspended, WFSTATE_Terminated
 
Fields inherited from class org.compiere.model.PO
ACCESSLEVEL_ALL, ACCESSLEVEL_CLIENT, ACCESSLEVEL_CLIENTORG, ACCESSLEVEL_ORG, ACCESSLEVEL_SYSTEM, ACCESSLEVEL_SYSTEMCLIENT, ENTITYTYPE_Dictionary, ENTITYTYPE_UserMaintained, I_ZERO, log, p_ctx, p_info, XML_ATTRIBUTE_AD_Table_ID, XML_ATTRIBUTE_Record_ID
 
Fields inherited from interface org.compiere.model.I_AD_WF_Activity
accessLevel, COLUMNNAME_AD_Message_ID, COLUMNNAME_AD_Table_ID, COLUMNNAME_AD_User_ID, COLUMNNAME_AD_WF_Activity_ID, COLUMNNAME_AD_WF_Node_ID, COLUMNNAME_AD_WF_Process_ID, COLUMNNAME_AD_WF_Responsible_ID, COLUMNNAME_AD_Workflow_ID, COLUMNNAME_DateLastAlert, COLUMNNAME_DynPriorityStart, COLUMNNAME_EndWaitTime, COLUMNNAME_Priority, COLUMNNAME_Processed, COLUMNNAME_Processing, COLUMNNAME_Record_ID, COLUMNNAME_TextMsg, COLUMNNAME_WFState, Model, Table_ID, Table_Name
 
Constructor Summary
MWFActivity(MWFProcess process, int AD_WF_Node_ID)
          Parent Contructor
MWFActivity(MWFProcess process, int next_ID, PO lastPO)
          Parent Contructor
MWFActivity(Properties ctx, int AD_WF_Activity_ID, String trxName)
          Standard Constructor
MWFActivity(Properties ctx, ResultSet rs, String trxName)
          Load Constructor
 
Method Summary
 void addTextMsg(Object obj)
          Add to Text Msg
 boolean forwardTo(int AD_User_ID, String textMsg)
          Forward To
static MWFActivity[] get(Properties ctx, int AD_Table_ID, int Record_ID, boolean activeOnly)
          Get Activities for table/record
static String getActiveInfo(Properties ctx, int AD_Table_ID, int Record_ID)
          Get Active Info
 int getApprovalUser(int AD_User_ID, int C_Currency_ID, BigDecimal amount, int AD_Org_ID, boolean ownDocument)
          Get Approval User.
 Object getAttributeValue()
          Get Attribute Value (based on Node) of PO
 MWFEventAudit getEventAudit()
          Get/Create Event Audit
 String getHistoryHTML()
          Get Process Activity (Event) History
 MWFNode getNode()
          Get WF Node
 String getNodeDescription()
          Get Node Description
 String getNodeHelp()
          Get Node Help
 String getNodeName()
          Get WF Node Name
 byte[] getPdfAttachment()
          Get PDF Attachment of underlying PO (!)
 int getPO_AD_Client_ID()
          Get PO AD_Client_ID
 PO getPO()
          Get Persistent Object
 PO getPO(Trx trx)
          Get Persistent Object in Transaction
 MWFResponsible getResponsible()
          Get Responsible
 StateEngine getState()
          Get State
 String getWFStateText()
          Get WF State text
 boolean isClosed()
          Is Activity closed
 boolean isInvoker()
          Is Invoker (no user & no role)
 boolean isPdfAttachment()
          Does the underlying PO (!)
 boolean isSOTrx()
          Is SO Trx
 boolean isUserApproval()
          Is this an user Approval step?
 boolean isUserChoice()
          Is this a user choice step?
 boolean isUserManual()
          Is this a Manual user step?
 void run()
          Execute Work.
 void setAD_WF_Node_ID(int AD_WF_Node_ID)
          Set AD_WF_Node_ID.
 void setTextMsg(String TextMsg)
          Set Text Msg (add to existing)
 boolean setUserChoice(int AD_User_ID, String value, int displayType, String textMsg)
          Set User Choice
 void setUserConfirmation(int AD_User_ID, String textMsg)
          Set User Confirmation
 void setWFState(String WFState)
          Set Activity State
 String toString()
          String Representation
 String toStringX()
          User String Representation.
 
Methods inherited from class org.compiere.model.X_AD_WF_Activity
get_AccessLevel, getAD_Message_ID, getAD_Message, getAD_Table_ID, getAD_Table, getAD_User_ID, getAD_WF_Activity_ID, getAD_WF_Node_ID, getAD_WF_Node, getAD_WF_Process_ID, getAD_WF_Process, getAD_WF_Responsible_ID, getAD_WF_Responsible, getAD_Workflow_ID, getAD_Workflow, getDateLastAlert, getDynPriorityStart, getEndWaitTime, getKeyNamePair, getPriority, getRecord_ID, getTextMsg, getWFState, initPO, isProcessed, isProcessing, setAD_Message_ID, setAD_Table_ID, setAD_User_ID, setAD_WF_Activity_ID, setAD_WF_Process_ID, setAD_WF_Responsible_ID, setAD_Workflow_ID, setDateLastAlert, setDynPriorityStart, setEndWaitTime, setPriority, setProcessed, setProcessing, setRecord_ID
 
Methods inherited from class org.compiere.model.PO
afterDelete, afterSave, beforeDelete, beforeSave, compare, copyValues, copyValues, createAttachment, delete_Accounting, delete_Tree, delete, delete, deleteEx, deleteEx, dump, dump, equals, get_ColumnCount, get_ColumnDescription, get_ColumnDisplayType, get_ColumnIndex, get_ColumnLabel, get_ColumnLookup, get_ColumnName, get_DisplayValue, get_HashMap, get_ID, get_IDOld, get_KeyColumns, get_Logger, get_Table_ID, get_TableName, get_Translation, get_TrxName, get_Value, get_Value, get_ValueAsInt, get_ValueAsString, get_ValueDifference, get_ValueDifference, get_ValueE, get_ValueOfColumn, get_ValueOld, get_ValueOld, get_ValueOldAsInt, get_WhereClause, get_xmlDocument, get_xmlString, getAD_Client_ID, getAD_Org_ID, getAllIDs, getAttachment, getAttachment, getAttachmentData, getCreated, getCreatedBy, getCtx, getDoc, getFindParameter, getUpdated, getUpdatedBy, insert_Accounting, insert_Tree, insert_Tree, is_Changed, is_new, is_ValueChanged, is_ValueChanged, isActive, isAttachment, isColumnMandatory, isColumnUpdateable, isMandatoryOK, isReplication, load, load, load, load, loadComplete, loadDefaults, loadSpecial, lock, save, save, saveEx, saveEx, saveNew_getID, saveNewSpecial, saveReplica, saveUpdate, set_ColumnUpdateable, set_CustomColumn, set_TrxName, set_TrxName, set_Value, set_Value, set_ValueE, set_ValueNoCheck, set_ValueNoCheckE, set_ValueOfColumn, set_ValueOfColumn, setAD_Client_ID, setAD_Org_ID, setClientOrg, setClientOrg, setDoc, setDocWorkflowMgr, setIsActive, setReplication, setStandardDefaults, setUpdateable, setUpdatedBy, unlock
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.compiere.model.I_Persistent
save
 

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,
                   int next_ID,
                   PO lastPO)
Parent Contructor

Parameters:
process - process
AD_WF_Node_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

setWFState

public void setWFState(String WFState)
Set Activity State

Specified by:
setWFState in interface I_AD_WF_Activity
Overrides:
setWFState in class X_AD_WF_Activity
Parameters:
WFState -

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

setAD_WF_Node_ID

public void setAD_WF_Node_ID(int AD_WF_Node_ID)
Set AD_WF_Node_ID. (Re)Set to Not Started

Specified by:
setAD_WF_Node_ID in interface I_AD_WF_Activity
Overrides:
setAD_WF_Node_ID in class X_AD_WF_Activity
Parameters:
AD_WF_Node_ID - now node

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

setTextMsg

public void setTextMsg(String TextMsg)
Set Text Msg (add to existing)

Specified by:
setTextMsg in interface I_AD_WF_Activity
Overrides:
setTextMsg in class X_AD_WF_Activity
Parameters:
TextMsg -

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 & 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

toString

public String toString()
String Representation

Overrides:
toString in class X_AD_WF_Activity
Returns:
info

toStringX

public String toStringX()
User String Representation. Suspended: Approve it (Joe)

Returns:
info

Adempiere 3.5.2a

Adempiere® is a registered trademark of ADempiere Business Inc. ©2004-2008 HumanFlash.com All rights reserved.