Package org.compiere.model
Class MPInstance
- java.lang.Object
-
- org.compiere.model.PO
-
- org.compiere.model.X_AD_PInstance
-
- org.compiere.model.MPInstance
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparator<Object>
,I_AD_PInstance
,I_Persistent
,Evaluatee
public class MPInstance extends X_AD_PInstance
Process Instance Model- Version:
- $Id: MPInstance.java,v 1.3 2006/07/30 00:58:36 jjanke Exp $
- Author:
- Jorg Janke, Teo Sarca, www.arhipac.ro
- FR [ 2818478 ] Introduce MPInstance.createParameter helper method https://sourceforge.net/p/adempiere/feature-requests/756/
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
ON_RUNNING_JOB_CHANGED_TOPIC
static int
RESULT_ERROR
Result FALSE = 0static int
RESULT_OK
Result OK = 1-
Fields inherited from class org.compiere.model.X_AD_PInstance
NOTIFICATIONTYPE_AD_Reference_ID, NOTIFICATIONTYPE_EMail, NOTIFICATIONTYPE_EMailPlusNotice, NOTIFICATIONTYPE_None, NOTIFICATIONTYPE_Notice
-
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, XML_ATTRIBUTE_AD_Table_ID, XML_ATTRIBUTE_Record_ID
-
Fields inherited from interface org.compiere.model.I_AD_PInstance
accessLevel, COLUMNNAME_AD_Client_ID, COLUMNNAME_AD_Language_ID, COLUMNNAME_AD_Org_ID, COLUMNNAME_AD_PInstance_ID, COLUMNNAME_AD_PInstance_UU, COLUMNNAME_AD_PrintFormat_ID, COLUMNNAME_AD_Process_ID, COLUMNNAME_AD_User_ID, COLUMNNAME_Created, COLUMNNAME_CreatedBy, COLUMNNAME_ErrorMsg, COLUMNNAME_IsActive, COLUMNNAME_IsProcessing, COLUMNNAME_IsRunAsJob, COLUMNNAME_IsSummary, COLUMNNAME_Name, COLUMNNAME_NotificationType, COLUMNNAME_Record_ID, COLUMNNAME_ReportType, COLUMNNAME_Result, COLUMNNAME_Updated, COLUMNNAME_UpdatedBy, Model, Table_ID, Table_Name
-
-
Constructor Summary
Constructors Constructor Description MPInstance(Properties ctx, int AD_Process_ID, int Record_ID)
New ConstructorMPInstance(Properties ctx, int AD_PInstance_ID, String ignored)
Standard ConstructorMPInstance(Properties ctx, ResultSet rs, String ignored)
Load ConstructorMPInstance(MProcess process, int Record_ID)
Create Process Instance from Process and create parameters
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MPInstanceLog
addLog(Timestamp P_Date, int P_ID, BigDecimal P_Number, String P_Msg)
MPInstanceLog
addLog(Timestamp P_Date, int P_ID, BigDecimal P_Number, String P_Msg, int AD_Table_ID, int Record_ID)
protected boolean
afterSave(boolean newRecord, boolean success)
After SaveMPInstancePara
createParameter(int seqNo, String parameterName, Object value)
Create Process Instance Parameter and save to databaseboolean
equalParameters(MPInstancePara[] params)
Validate that a set of process instance parameters are equal or not to the current instance parameterstatic List<MPInstance>
get(Properties ctx, int AD_Process_ID, int AD_User_ID)
I_AD_Process
getAD_Process()
MPInstanceLog[]
getLog()
Get LogsMPInstancePara[]
getParameters()
Get Parametersboolean
isOK()
Is it OKvoid
log()
Dump Logstatic void
postOnChangedEvent(int AD_User_ID)
static void
publishChangedEvent(int AD_User_ID)
void
setAD_Process_ID(int AD_Process_ID)
Set AD_Process_ID.void
setRecord_ID(int Record_ID)
Set Record ID.void
setResult(boolean ok)
Set ResultString
toString()
String Representation-
Methods inherited from class org.compiere.model.X_AD_PInstance
get_AccessLevel, getAD_Language, getAD_Language_ID, getAD_PInstance_ID, getAD_PInstance_UU, getAD_PrintFormat, getAD_PrintFormat_ID, getAD_Process_ID, getAD_User, getAD_User_ID, getErrorMsg, getKeyNamePair, getName, getNotificationType, getRecord_ID, getReportType, getResult, initPO, isProcessing, isRunAsJob, isSummary, setAD_Language_ID, setAD_PInstance_ID, setAD_PInstance_UU, setAD_PrintFormat_ID, setAD_User_ID, setErrorMsg, setIsProcessing, setIsRunAsJob, setIsSummary, setName, setNotificationType, setReportType, setResult
-
Methods inherited from class org.compiere.model.PO
afterDelete, beforeDelete, beforeSave, 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_Value, get_Value, get_ValueAsBoolean, get_ValueAsInt, get_ValueAsInt, 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, load, loadByUU, loadComplete, loadDefaults, loadSpecial, lock, makeImmutable, postDelete, retrieveIdOfParentValue, retrieveIdOfParentValue, save, save, 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, setClientOrg, setCrossTenantSafe, setDoc, setDocWorkflowMgr, setIsActive, setProcessedOn, setReplication, setStandardDefaults, setUpdateable, setUpdatedBy, 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_PInstance
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
-
-
-
-
Field Detail
-
ON_RUNNING_JOB_CHANGED_TOPIC
public static final String ON_RUNNING_JOB_CHANGED_TOPIC
- See Also:
- Constant Field Values
-
RESULT_OK
public static final int RESULT_OK
Result OK = 1- See Also:
- Constant Field Values
-
RESULT_ERROR
public static final int RESULT_ERROR
Result FALSE = 0- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MPInstance
public MPInstance(Properties ctx, int AD_PInstance_ID, String ignored)
Standard Constructor- Parameters:
ctx
- contextAD_PInstance_ID
- instance or 0ignored
- no transaction support
-
MPInstance
public MPInstance(Properties ctx, ResultSet rs, String ignored)
Load Constructor- Parameters:
ctx
- contextrs
- result setignored
- no transaction support
-
MPInstance
public MPInstance(MProcess process, int Record_ID)
Create Process Instance from Process and create parameters- Parameters:
process
- processRecord_ID
- Record
-
MPInstance
public MPInstance(Properties ctx, int AD_Process_ID, int Record_ID)
New Constructor- Parameters:
ctx
- contextAD_Process_ID
- Process IDRecord_ID
- record
-
-
Method Detail
-
getParameters
public MPInstancePara[] getParameters()
Get Parameters- Returns:
- parameter array
-
equalParameters
public boolean equalParameters(MPInstancePara[] params)
Validate that a set of process instance parameters are equal or not to the current instance parameter- Parameters:
params
- array of parameters to compare- Returns:
- true if the process instance parameters are the same as the array ones
-
getLog
public MPInstanceLog[] getLog()
Get Logs- Returns:
- array of logs
-
addLog
public MPInstanceLog addLog(Timestamp P_Date, int P_ID, BigDecimal P_Number, String P_Msg)
- Parameters:
P_Date
- dateP_ID
- idP_Number
- numberP_Msg
- msg
-
addLog
public MPInstanceLog addLog(Timestamp P_Date, int P_ID, BigDecimal P_Number, String P_Msg, int AD_Table_ID, int Record_ID)
- Parameters:
P_Date
- dateP_ID
- idP_Number
- numberP_Msg
- msgAD_Table_ID
- tableIDRecord_ID
- recordID- Returns:
-
setAD_Process_ID
public void setAD_Process_ID(int AD_Process_ID)
Set AD_Process_ID. Check Role if process can be performed- Specified by:
setAD_Process_ID
in interfaceI_AD_PInstance
- Overrides:
setAD_Process_ID
in classX_AD_PInstance
- Parameters:
AD_Process_ID
- process
-
setRecord_ID
public void setRecord_ID(int Record_ID)
Set Record ID. direct internal record ID- Specified by:
setRecord_ID
in interfaceI_AD_PInstance
- Overrides:
setRecord_ID
in classX_AD_PInstance
- Parameters:
Record_ID
- record
-
toString
public String toString()
String Representation- Overrides:
toString
in classX_AD_PInstance
- Returns:
- info
- See Also:
Object.toString()
-
log
public void log()
Dump Log
-
isOK
public boolean isOK()
Is it OK- Returns:
- Result == OK
-
setResult
public void setResult(boolean ok)
Set Result- Parameters:
ok
-
-
afterSave
protected boolean afterSave(boolean newRecord, boolean success)
After Save
-
createParameter
public MPInstancePara createParameter(int seqNo, String parameterName, Object value)
Create Process Instance Parameter and save to database- Parameters:
seqNo
- parameter sequence#parameterName
- parameter namevalue
- parameter value- Returns:
-
getAD_Process
public I_AD_Process getAD_Process() throws RuntimeException
- Specified by:
getAD_Process
in interfaceI_AD_PInstance
- Overrides:
getAD_Process
in classX_AD_PInstance
- Throws:
RuntimeException
-
publishChangedEvent
public static void publishChangedEvent(int AD_User_ID)
-
postOnChangedEvent
public static void postOnChangedEvent(int AD_User_ID)
-
get
public static List<MPInstance> get(Properties ctx, int AD_Process_ID, int AD_User_ID)
-
-