Package org.compiere.wf
Class MWFNode
java.lang.Object
org.compiere.model.PO
org.compiere.model.X_AD_WF_Node
org.compiere.wf.MWFNode
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparator<Object>
,I_AD_WF_Node
,I_Persistent
,Evaluatee
,ImmutablePOSupport
Extended Workflow Node Model for AD_WF_Node
- Version:
- $Id: MWFNode.java,v 1.2 2006/07/30 00:51:05 jjanke Exp $
- Author:
- Jorg Janke, Teo Sarca, www.arhipac.ro
- FR [ 2214883 ] Remove SQL code and Replace for Query
- BF [ 2815732 ] MWFNode.getWorkflow not working in trx https://sourceforge.net/p/adempiere/bugs/1964/
- See Also:
-
Field Summary
Fields inherited from class org.compiere.model.X_AD_WF_Node
ACTION_AD_Reference_ID, ACTION_AppsProcess, ACTION_AppsReport, ACTION_AppsTask, ACTION_DocumentAction, ACTION_EMail, ACTION_SetVariable, ACTION_SubWorkflow, ACTION_UserChoice, ACTION_UserForm, ACTION_UserInfo, ACTION_UserWindow, ACTION_UserWorkbench, ACTION_WaitSleep, DOCACTION_AD_Reference_ID, DOCACTION_Approve, DOCACTION_Close, DOCACTION_Complete, DOCACTION_Invalidate, DOCACTION_None, DOCACTION_Post, DOCACTION_Prepare, DOCACTION_Re_Activate, DOCACTION_Reject, DOCACTION_Reverse_Accrual, DOCACTION_Reverse_Correct, DOCACTION_Unlock, DOCACTION_Void, DOCACTION_WaitComplete, DYNPRIORITYUNIT_AD_Reference_ID, DYNPRIORITYUNIT_Day, DYNPRIORITYUNIT_Hour, DYNPRIORITYUNIT_Minute, EMAILRECIPIENT_AD_Reference_ID, EMAILRECIPIENT_DocumentBusinessPartner, EMAILRECIPIENT_DocumentOwner, EMAILRECIPIENT_WFResponsible, ENTITYTYPE_AD_Reference_ID, FINISHMODE_AD_Reference_ID, FINISHMODE_Automatic, FINISHMODE_Manual, JOINELEMENT_AD_Reference_ID, JOINELEMENT_AND, JOINELEMENT_XOR, SPLITELEMENT_AD_Reference_ID, SPLITELEMENT_AND, SPLITELEMENT_XOR, STARTMODE_AD_Reference_ID, STARTMODE_Automatic, STARTMODE_Manual, SUBFLOWEXECUTION_AD_Reference_ID, SUBFLOWEXECUTION_Asynchronously, SUBFLOWEXECUTION_Synchronously
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, LOCAL_TRX_PREFIX, log, p_ctx, p_info, UUID_NEW_RECORD, XML_ATTRIBUTE_AD_Table_ID, XML_ATTRIBUTE_Record_ID
Fields inherited from interface org.compiere.model.I_AD_WF_Node
accessLevel, COLUMNNAME_Action, COLUMNNAME_AD_Client_ID, COLUMNNAME_AD_Column_ID, COLUMNNAME_AD_CtxHelp_ID, COLUMNNAME_AD_Form_ID, COLUMNNAME_AD_Image_ID, COLUMNNAME_AD_InfoWindow_ID, COLUMNNAME_AD_Org_ID, COLUMNNAME_AD_Process_ID, COLUMNNAME_AD_Task_ID, COLUMNNAME_AD_WF_Block_ID, COLUMNNAME_AD_WF_Node_ID, COLUMNNAME_AD_WF_Node_UU, COLUMNNAME_AD_WF_Responsible_ID, COLUMNNAME_AD_Window_ID, COLUMNNAME_AD_Workflow_ID, COLUMNNAME_AttributeName, COLUMNNAME_AttributeValue, COLUMNNAME_C_BPartner_ID, COLUMNNAME_Cost, COLUMNNAME_Created, COLUMNNAME_CreatedBy, COLUMNNAME_Description, COLUMNNAME_DocAction, COLUMNNAME_Duration, COLUMNNAME_DynPriorityChange, COLUMNNAME_DynPriorityUnit, COLUMNNAME_EMail, COLUMNNAME_EMailRecipient, COLUMNNAME_EntityType, COLUMNNAME_FinishMode, COLUMNNAME_Help, COLUMNNAME_IsActive, COLUMNNAME_IsAttachedDocumentToEmail, COLUMNNAME_IsCentrallyMaintained, COLUMNNAME_IsMilestone, COLUMNNAME_IsSubcontracting, COLUMNNAME_JoinElement, COLUMNNAME_Limit, COLUMNNAME_MovingTime, COLUMNNAME_Name, COLUMNNAME_OverlapUnits, COLUMNNAME_Priority, COLUMNNAME_QueuingTime, COLUMNNAME_R_MailText_ID, COLUMNNAME_S_Resource_ID, COLUMNNAME_SetupTime, COLUMNNAME_SplitElement, COLUMNNAME_StartMode, COLUMNNAME_SubflowExecution, COLUMNNAME_UnitsCycles, COLUMNNAME_Updated, COLUMNNAME_UpdatedBy, COLUMNNAME_ValidFrom, COLUMNNAME_ValidTo, COLUMNNAME_Value, COLUMNNAME_WaitingTime, COLUMNNAME_WaitTime, COLUMNNAME_Workflow_ID, COLUMNNAME_WorkingTime, COLUMNNAME_XPosition, COLUMNNAME_Yield, COLUMNNAME_YPosition, Model, Table_ID, Table_Name
-
Constructor Summary
ConstructorDescriptionMWFNode
(Properties ctx, int AD_WF_Node_ID, String trxName) Standard Constructor - save to cacheMWFNode
(Properties ctx, String AD_WF_Node_UU, String trxName) UUID based ConstructorMWFNode
(Properties ctx, ResultSet rs, String trxName) Load Constructor - save to cacheMWFNode
(Properties ctx, MWFNode copy) Copy constructorMWFNode
(Properties ctx, MWFNode copy, String trxName) Copy constructorCopy constructorParent Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
beforeSave
(boolean newRecord) Called before Save for Pre-Save Operation.
Default implementation is nop, to be implemented in sub-classes that needed it.int
calculateDynamicPriority
(int seconds) Calculate Dynamic Prioritystatic MWFNode
get
(int AD_WF_Node_ID) Get WF Node from Cachestatic MWFNode
get
(Properties ctx, int AD_WF_Node_ID) Get WF Node from CacheGet Action InfoGet Attribute NameGet Columnstatic MWFNode
getCopy
(Properties ctx, int AD_WF_Node_ID, String trxName) Get updateable copy of MWFNode from cachegetDescription
(boolean translated) Get Descriptionint
Get Duration Calendar Fieldlong
Get Duration in msgetHelp
(boolean translated) Get Helplong
Get Duration Limit in msgetName
(boolean translated) Get Nameint
Get Number of Next NodesGet Node ParametersGet PositiongetTransitions
(int AD_Client_ID) Get next nodes for transitionsstatic MWFNode[]
getWFNodes
(Properties ctx, String whereClause, String trxName) Get workflow nodes with where clause.Deprecated.boolean
Is this an Approval setp?boolean
Is this a User Choice step?boolean
Is this a Manual user step?boolean
isValidFromTo
(Timestamp date) Check if the workflow node is valid for given datemark PO as immutablevoid
setClientOrg
(int AD_Client_ID, int AD_Org_ID) Set Client Orgvoid
setPosition
(int x, int y) Set Positionvoid
setPosition
(Point position) Set PositiontoString()
String RepresentationUser String RepresentationMethods inherited from class org.compiere.model.X_AD_WF_Node
get_AccessLevel, getAction, getAD_Column, getAD_Column_ID, getAD_CtxHelp, getAD_CtxHelp_ID, getAD_Form, getAD_Form_ID, getAD_Image, getAD_Image_ID, getAD_InfoWindow, getAD_InfoWindow_ID, getAD_Process, getAD_Process_ID, getAD_Task, getAD_Task_ID, getAD_WF_Block, getAD_WF_Block_ID, getAD_WF_Node_ID, getAD_WF_Node_UU, getAD_WF_Responsible, getAD_WF_Responsible_ID, getAD_Window, getAD_Window_ID, getAD_Workflow_ID, getAttributeValue, getC_BPartner, getC_BPartner_ID, getCost, getDescription, getDocAction, getDuration, getDynPriorityChange, getDynPriorityUnit, getEMail, getEMailRecipient, getEntityType, getFinishMode, getHelp, getJoinElement, getKeyNamePair, getLimit, getMovingTime, getName, getOverlapUnits, getPriority, getQueuingTime, getR_MailText, getR_MailText_ID, getS_Resource, getS_Resource_ID, getSetupTime, getSplitElement, getStartMode, getSubflowExecution, getUnitsCycles, getValidFrom, getValidTo, getValue, getWaitingTime, getWaitTime, getWorkflow_ID, getWorkingTime, getXPosition, getYield, getYPosition, initPO, isAttachedDocumentToEmail, isCentrallyMaintained, isMilestone, isSubcontracting, setAction, setAD_Column_ID, setAD_CtxHelp_ID, setAD_Form_ID, setAD_Image_ID, setAD_InfoWindow_ID, setAD_Process_ID, setAD_Task_ID, setAD_WF_Block_ID, setAD_WF_Node_ID, setAD_WF_Node_UU, setAD_WF_Responsible_ID, setAD_Window_ID, setAD_Workflow_ID, setAttributeName, setAttributeValue, setC_BPartner_ID, setCost, setDescription, setDocAction, setDuration, setDynPriorityChange, setDynPriorityUnit, setEMail, setEMailRecipient, setEntityType, setFinishMode, setHelp, setIsAttachedDocumentToEmail, setIsCentrallyMaintained, setIsMilestone, setIsSubcontracting, setJoinElement, setLimit, setMovingTime, setName, setOverlapUnits, setPriority, setQueuingTime, setR_MailText_ID, setS_Resource_ID, setSetupTime, setSplitElement, setStartMode, setSubflowExecution, setUnitsCycles, setValidFrom, setValidTo, setValue, setWaitingTime, setWaitTime, setWorkflow_ID, setWorkingTime, setXPosition, setYield, setYPosition
Methods inherited from class org.compiere.model.PO
afterDelete, afterSave, beforeDelete, buildInsertSQL, checkImmutable, clearCrossTenantSafe, clone, columnExists, columnExists, compare, copyPO, copyValues, copyValues, createAttachment, delete, delete, delete_Accounting, delete_Tree, deleteEx, deleteEx, dump, dump, equals, get_Attribute, get_Attributes, 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_OptimisticLockingColumns, get_Table_ID, get_TableName, get_Translation, get_Translation, get_Translation, get_Translation, get_Translation, get_TrxName, get_UUID, get_Value, get_Value, get_ValueAsBoolean, get_ValueAsInt, get_ValueAsInt, get_ValueAsString, get_ValueAsString, get_ValueDifference, get_ValueDifference, get_ValueE, get_ValueOfColumn, get_ValueOld, get_ValueOld, get_ValueOldAsInt, get_WhereClause, get_WhereClause, get_xmlDocument, get_xmlString, getAD_Client_ID, getAD_Org_ID, getAllIDs, getAttachment, getAttachment, getAttachmentData, getCreated, getCreatedBy, getCtx, getDoc, getFindParameter, getPdfAttachment, getUpdated, getUpdatedBy, getUUIDColumnName, getUUIDColumnName, hashCode, insert_Accounting, insert_Tree, insert_Tree, is_Changed, is_Immutable, is_new, is_UseOptimisticLocking, is_ValueChanged, is_ValueChanged, isActive, isAttachment, isColumnMandatory, isColumnUpdateable, isMandatoryOK, isPdfAttachment, isReplication, load, load, load, load, loadByUU, loadComplete, loadDefaults, loadPO, loadSpecial, lock, makeImmutable, postDelete, retrieveIdOfParentValue, retrieveIdOfParentValue, save, save, saveCrossTenantSafe, saveCrossTenantSafeEx, saveCrossTenantSafeEx, saveEx, saveEx, saveNew_afterSetID, saveNew_getID, saveNewSpecial, saveReplica, saveUpdate, set_Attribute, set_ColumnUpdateable, set_CustomColumn, set_CustomColumnReturningBoolean, set_OptimisticLockingColumns, set_TrxName, set_TrxName, set_UseOptimisticLocking, set_Value, set_Value, set_Value, set_Value, set_ValueE, set_ValueNoCheck, set_ValueNoCheckE, set_ValueOfColumn, set_ValueOfColumn, set_ValueOfColumnReturningBoolean, set_ValueOfColumnReturningBoolean, setAD_Client_ID, setAD_Org_ID, setClientOrg, setCrossTenantSafe, setDoc, setDocWorkflowMgr, setIsActive, setProcessedOn, setReplication, setStandardDefaults, setUpdateable, setUpdatedBy, toInsertSQL, unlock, update_Tree, validForeignKeys
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
Methods inherited from interface org.compiere.model.I_AD_WF_Node
getAD_Client_ID, getAD_Org_ID, getCreated, getCreatedBy, getUpdated, getUpdatedBy, isActive, setAD_Org_ID, setIsActive
Methods inherited from interface org.compiere.model.I_Persistent
save
-
Constructor Details
-
MWFNode
UUID based Constructor- Parameters:
ctx
- ContextAD_WF_Node_UU
- UUID keytrxName
- Transaction
-
MWFNode
Standard Constructor - save to cache- Parameters:
ctx
- contextAD_WF_Node_ID
- idtrxName
- transaction
-
MWFNode
Parent Constructor- Parameters:
wf
- workflow (parent)Value
- valueName
- name
-
MWFNode
Load Constructor - save to cache- Parameters:
ctx
- contextrs
- result set to load info fromtrxName
- transaction
-
MWFNode
Copy constructor- Parameters:
copy
-
-
MWFNode
Copy constructor- Parameters:
ctx
-copy
-
-
MWFNode
Copy constructor- Parameters:
ctx
-copy
-trxName
-
-
-
Method Details
-
get
Get WF Node from Cache- Parameters:
AD_WF_Node_ID
- id- Returns:
- MWFNode
-
get
Get WF Node from Cache- Parameters:
ctx
- contextAD_WF_Node_ID
- id- Returns:
- MWFNode
-
getCopy
Get updateable copy of MWFNode from cache- Parameters:
ctx
-AD_WF_Node_ID
-trxName
-- Returns:
- MWFNode
-
setClientOrg
public void setClientOrg(int AD_Client_ID, int AD_Org_ID) Set Client Org- Overrides:
setClientOrg
in classPO
- Parameters:
AD_Client_ID
- clientAD_Org_ID
- org
-
getNextNodeCount
public int getNextNodeCount()Get Number of Next Nodes- Returns:
- number of next nodes
-
getTransitions
Get next nodes for transitions- Parameters:
AD_Client_ID
- for client- Returns:
- array of next nodes
-
getName
Get Name- Parameters:
translated
- translated- Returns:
- Name
-
getDescription
Get Description- Parameters:
translated
- translated- Returns:
- Description
-
getHelp
Get Help- Parameters:
translated
- translated- Returns:
- Name
-
setPosition
Set Position- Parameters:
position
- point
-
setPosition
public void setPosition(int x, int y) Set Position- Parameters:
x
- xy
- y
-
getPosition
Get Position- Returns:
- position point
-
getActionInfo
Get Action Info- Returns:
- action info text
-
getAttributeName
Get Attribute Name- Specified by:
getAttributeName
in interfaceI_AD_WF_Node
- Overrides:
getAttributeName
in classX_AD_WF_Node
- Returns:
- Attribute Name
- See Also:
-
getColumn
Get Column- Returns:
- column or null
-
isUserApproval
public boolean isUserApproval()Is this an Approval setp?- Returns:
- true if User Approval
-
isUserChoice
public boolean isUserChoice()Is this a User Choice step?- Returns:
- true if User Choice
-
isUserManual
public boolean isUserManual()Is this a Manual user step?- Returns:
- true if Window/Form/Workbench
-
getDurationMS
public long getDurationMS()Get Duration in ms- Returns:
- duration in ms
-
getLimitMS
public long getLimitMS()Get Duration Limit in ms- Returns:
- duration limit in ms
-
getDurationCalendarField
public int getDurationCalendarField()Get Duration Calendar Field- Returns:
- Calendar Field (Calendar.MINUTE, etc.)
-
calculateDynamicPriority
public int calculateDynamicPriority(int seconds) Calculate Dynamic Priority- Parameters:
seconds
- second after created- Returns:
- Dynamic Priority
-
getParameters
Get Node Parameters- Returns:
- array of node parameters
-
getWorkflow
Deprecated.please usegetAD_Workflow()
Get Workflow- Specified by:
getWorkflow
in interfaceI_AD_WF_Node
- Overrides:
getWorkflow
in classX_AD_WF_Node
- Returns:
- workflow
-
getAD_Workflow
- Specified by:
getAD_Workflow
in interfaceI_AD_WF_Node
- Overrides:
getAD_Workflow
in classX_AD_WF_Node
-
toString
String Representation- Overrides:
toString
in classX_AD_WF_Node
- Returns:
- info
-
toStringX
User String Representation- Returns:
- info
-
beforeSave
protected boolean beforeSave(boolean newRecord) Description copied from class:PO
Called before Save for Pre-Save Operation.
Default implementation is nop, to be implemented in sub-classes that needed it.- Overrides:
beforeSave
in classPO
- Parameters:
newRecord
- true if it is a new record- Returns:
- true if record can be saved
-
isValidFromTo
Check if the workflow node is valid for given date- Parameters:
date
-- Returns:
- true if node is valid for the given date
-
markImmutable
Description copied from interface:ImmutablePOSupport
mark PO as immutable- Specified by:
markImmutable
in interfaceImmutablePOSupport
- Returns:
- PO
-
getWFNodes
Get workflow nodes with where clause.- Parameters:
ctx
- contextwhereClause
- where clause w/o the WHERE keywordtrxName
- transaction- Returns:
- array of workflow nodes
-
getAD_Workflow()