Adempiere 3.5.2a

org.compiere.wf
Class MWorkflow

java.lang.Object
  extended by org.compiere.model.PO
      extended by org.compiere.model.X_AD_Workflow
          extended by org.compiere.wf.MWorkflow
All Implemented Interfaces:
Serializable, Comparator, I_AD_Workflow, I_Persistent, Evaluatee

public class MWorkflow
extends X_AD_Workflow

WorkFlow Model

Version:
$Id: MWorkflow.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_Workflow
ACCESSLEVEL_AD_Reference_ID, ACCESSLEVEL_All, ACCESSLEVEL_ClientOnly, ACCESSLEVEL_ClientPlusOrganization, ACCESSLEVEL_Organization, ACCESSLEVEL_SystemOnly, ACCESSLEVEL_SystemPlusClient, DURATIONUNIT_AD_Reference_ID, DURATIONUNIT_Day, DURATIONUNIT_Hour, DURATIONUNIT_Minute, DURATIONUNIT_Month, DURATIONUNIT_Second, DURATIONUNIT_Year, ENTITYTYPE_AD_Reference_ID, PROCESSTYPE_AD_Reference_ID, PROCESSTYPE_BatchFlow, PROCESSTYPE_ContinuousFlow, PROCESSTYPE_DedicateRepetititiveFlow, PROCESSTYPE_JobShop, PROCESSTYPE_MixedRepetitiveFlow, PROCESSTYPE_Plant, PUBLISHSTATUS_AD_Reference_ID, PUBLISHSTATUS_Released, PUBLISHSTATUS_Test, PUBLISHSTATUS_UnderRevision, PUBLISHSTATUS_Void, WORKFLOWTYPE_AD_Reference_ID, WORKFLOWTYPE_DocumentProcess, WORKFLOWTYPE_DocumentValue, WORKFLOWTYPE_General, WORKFLOWTYPE_Manufacturing, WORKFLOWTYPE_Quality
 
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_Workflow
accessLevel, COLUMNNAME_AccessLevel, COLUMNNAME_AD_Table_ID, COLUMNNAME_AD_WF_Node_ID, COLUMNNAME_AD_WF_Responsible_ID, COLUMNNAME_AD_Workflow_ID, COLUMNNAME_AD_WorkflowProcessor_ID, COLUMNNAME_Author, COLUMNNAME_Cost, COLUMNNAME_Description, COLUMNNAME_DocumentNo, COLUMNNAME_DocValueLogic, COLUMNNAME_Duration, COLUMNNAME_DurationUnit, COLUMNNAME_EntityType, COLUMNNAME_Help, COLUMNNAME_IsDefault, COLUMNNAME_IsValid, COLUMNNAME_Limit, COLUMNNAME_MovingTime, COLUMNNAME_Name, COLUMNNAME_Priority, COLUMNNAME_ProcessType, COLUMNNAME_PublishStatus, COLUMNNAME_QtyBatchSize, COLUMNNAME_QueuingTime, COLUMNNAME_S_Resource_ID, COLUMNNAME_SetupTime, COLUMNNAME_ValidateWorkflow, COLUMNNAME_ValidFrom, COLUMNNAME_ValidTo, COLUMNNAME_Value, COLUMNNAME_Version, COLUMNNAME_WaitingTime, COLUMNNAME_WorkflowType, COLUMNNAME_WorkingTime, Model, Table_ID, Table_Name
 
Constructor Summary
MWorkflow(Properties ctx, int AD_Workflow_ID, String trxName)
          Create/Load Workflow
MWorkflow(Properties ctx, ResultSet rs, String trxName)
          Load Constructor
 
Method Summary
protected  boolean afterSave(boolean newRecord, boolean success)
          After Save.
protected  boolean beforeSave(boolean newRecord)
          Before Save
static MWorkflow get(Properties ctx, int AD_Workflow_ID)
          Get Workflow from Cache
 String getDescription(boolean translated)
          Get Description
static MWorkflow[] getDocValue(Properties ctx, int AD_Client_ID, int AD_Table_ID, String trxName)
          Get Doc Value Workflow
 long getDurationBaseSec()
          Get Duration Base in Seconds
 int getDurationCalendarField()
          Get Duration CalendarField
 MWFNode getFirstNode()
          Get the first node
 String getHelp(boolean translated)
          Get Help
 int getLast(int AD_WF_Node_ID, int AD_Client_ID)
          Get very Last Node
 String getName(boolean translated)
          Get Name
 int getNext(int AD_WF_Node_ID, int AD_Client_ID)
          Get first transition (Next Node) of ID
 MWFNode[] getNextNodes(int AD_WF_Node_ID, int AD_Client_ID)
          Get the next nodes
protected  MWFNode getNode(int AD_WF_Node_ID)
          Get Node with ID in Workflow
 int getNodeCount()
          Get Number of Nodes
 MWFNodeNext[] getNodeNexts(int AD_WF_Node_ID, int AD_Client_ID)
          Get Transitions (NodeNext) of ID
 MWFNode[] getNodes(boolean ordered, int AD_Client_ID)
          Get the nodes
 int getPrevious(int AD_WF_Node_ID, int AD_Client_ID)
          Get (first) Previous Node of ID
 boolean isFirst(int AD_WF_Node_ID, int AD_Client_ID)
          Is this the first Node
 boolean isLast(int AD_WF_Node_ID, int AD_Client_ID)
          Is this the last Node
static void main(String[] args)
          main
 MWFProcess start(ProcessInfo pi)
          Deprecated.  
 MWFProcess start(ProcessInfo pi, String trxName)
          Start Workflow.
 MWFProcess startWait(ProcessInfo pi)
          Start Workflow and Wait for completion.
 String toString()
          String Representation
 String validate()
          Validate workflow.
 
Methods inherited from class org.compiere.model.X_AD_Workflow
get_AccessLevel, getAccessLevel, getAD_Table_ID, getAD_Table, getAD_WF_Node_ID, getAD_WF_Node, getAD_WF_Responsible_ID, getAD_WF_Responsible, getAD_Workflow_ID, getAD_WorkflowProcessor_ID, getAD_WorkflowProcessor, getAuthor, getCost, getDescription, getDocumentNo, getDocValueLogic, getDuration, getDurationUnit, getEntityType, getHelp, getKeyNamePair, getLimit, getMovingTime, getName, getPriority, getProcessType, getPublishStatus, getQtyBatchSize, getQueuingTime, getS_Resource_ID, getS_Resource, getSetupTime, getValidateWorkflow, getValidFrom, getValidTo, getValue, getVersion, getWaitingTime, getWorkflowType, getWorkingTime, initPO, isDefault, isValid, setAccessLevel, setAD_Table_ID, setAD_WF_Node_ID, setAD_WF_Responsible_ID, setAD_Workflow_ID, setAD_WorkflowProcessor_ID, setAuthor, setCost, setDescription, setDocumentNo, setDocValueLogic, setDuration, setDurationUnit, setEntityType, setHelp, setIsDefault, setIsValid, setLimit, setMovingTime, setName, setPriority, setProcessType, setPublishStatus, setQtyBatchSize, setQueuingTime, setS_Resource_ID, setSetupTime, setValidateWorkflow, setValidFrom, setValidTo, setValue, setVersion, setWaitingTime, setWorkflowType, setWorkingTime
 
Methods inherited from class org.compiere.model.PO
afterDelete, beforeDelete, 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, getPdfAttachment, getUpdated, getUpdatedBy, insert_Accounting, insert_Tree, insert_Tree, is_Changed, is_new, is_ValueChanged, is_ValueChanged, isActive, isAttachment, isColumnMandatory, isColumnUpdateable, isMandatoryOK, isPdfAttachment, 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

MWorkflow

public MWorkflow(Properties ctx,
                 int AD_Workflow_ID,
                 String trxName)
Create/Load Workflow

Parameters:
ctx - Context
AD_Workflow_ID - ID
trxName - transaction

MWorkflow

public MWorkflow(Properties ctx,
                 ResultSet rs,
                 String trxName)
Load Constructor

Parameters:
ctx - context
rs - result set
trxName - transaction
Method Detail

get

public static MWorkflow get(Properties ctx,
                            int AD_Workflow_ID)
Get Workflow from Cache

Parameters:
ctx - context
AD_Workflow_ID - id
Returns:
workflow

getDocValue

public static MWorkflow[] getDocValue(Properties ctx,
                                      int AD_Client_ID,
                                      int AD_Table_ID,
                                      String trxName)
Get Doc Value Workflow

Parameters:
ctx - context
AD_Client_ID - client
AD_Table_ID - table
Returns:
document value workflow array or null

getNodeCount

public int getNodeCount()
Get Number of Nodes

Returns:
number of nodes

getNodes

public MWFNode[] getNodes(boolean ordered,
                          int AD_Client_ID)
Get the nodes

Parameters:
ordered - ordered array
AD_Client_ID - for client
Returns:
array of nodes

getFirstNode

public MWFNode getFirstNode()
Get the first node

Returns:
array of next nodes

getNode

protected MWFNode getNode(int AD_WF_Node_ID)
Get Node with ID in Workflow

Parameters:
AD_WF_Node_ID - ID
Returns:
node or null

getNextNodes

public MWFNode[] getNextNodes(int AD_WF_Node_ID,
                              int AD_Client_ID)
Get the next nodes

Parameters:
AD_WF_Node_ID - ID
AD_Client_ID - for client
Returns:
array of next nodes or null

getNext

public int getNext(int AD_WF_Node_ID,
                   int AD_Client_ID)
Get first transition (Next Node) of ID

Parameters:
AD_WF_Node_ID - id
AD_Client_ID - for client
Returns:
next AD_WF_Node_ID or 0

getNodeNexts

public MWFNodeNext[] getNodeNexts(int AD_WF_Node_ID,
                                  int AD_Client_ID)
Get Transitions (NodeNext) of ID

Parameters:
AD_WF_Node_ID - id
AD_Client_ID - for client
Returns:
array of next nodes

getPrevious

public int getPrevious(int AD_WF_Node_ID,
                       int AD_Client_ID)
Get (first) Previous Node of ID

Parameters:
AD_WF_Node_ID - id
AD_Client_ID - for client
Returns:
next AD_WF_Node_ID or 0

getLast

public int getLast(int AD_WF_Node_ID,
                   int AD_Client_ID)
Get very Last Node

Parameters:
AD_WF_Node_ID - ignored
AD_Client_ID - for client
Returns:
next AD_WF_Node_ID or 0

isFirst

public boolean isFirst(int AD_WF_Node_ID,
                       int AD_Client_ID)
Is this the first Node

Parameters:
AD_WF_Node_ID - id
AD_Client_ID - for client
Returns:
true if first node

isLast

public boolean isLast(int AD_WF_Node_ID,
                      int AD_Client_ID)
Is this the last Node

Parameters:
AD_WF_Node_ID - id
AD_Client_ID - for client
Returns:
true if last node

getName

public String getName(boolean translated)
Get Name

Parameters:
translated - translated
Returns:
Name

getDescription

public String getDescription(boolean translated)
Get Description

Parameters:
translated - translated
Returns:
Description

getHelp

public String getHelp(boolean translated)
Get Help

Parameters:
translated - translated
Returns:
Name

toString

public String toString()
String Representation

Overrides:
toString in class X_AD_Workflow
Returns:
info

beforeSave

protected boolean beforeSave(boolean newRecord)
Before Save

Overrides:
beforeSave in class PO
Parameters:
newRecord - new
Returns:
true

afterSave

protected boolean afterSave(boolean newRecord,
                            boolean success)
After Save.

Overrides:
afterSave in class PO
Parameters:
newRecord - new record
success - success
Returns:
true if save complete (if not overwritten true)

start

public MWFProcess start(ProcessInfo pi)
Deprecated. 

Start Workflow.

Parameters:
pi - Process Info (Record_ID)
Returns:
process

start

public MWFProcess start(ProcessInfo pi,
                        String trxName)
Start Workflow.

Parameters:
pi - Process Info (Record_ID)
Returns:
process

startWait

public MWFProcess startWait(ProcessInfo pi)
Start Workflow and Wait for completion.

Parameters:
pi - process info with Record_ID record for the workflow
Returns:
process

getDurationBaseSec

public long getDurationBaseSec()
Get Duration Base in Seconds

Returns:
duration unit in seconds

getDurationCalendarField

public int getDurationCalendarField()
Get Duration CalendarField

Returns:
Calendar.MINUTE, etc.

validate

public String validate()
Validate workflow. Sets Valid flag

Returns:
errors or ""

main

public static void main(String[] args)
main

Parameters:
args -

Adempiere 3.5.2a

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