Class MProcess

All Implemented Interfaces:
Serializable, Cloneable, Comparator<Object>, I_AD_Process, I_Persistent, Evaluatee, ImmutablePOSupport

public class MProcess extends X_AD_Process implements ImmutablePOSupport
Process Model
Version:
$Id: MProcess.java,v 1.4 2006/07/30 00:58:04 jjanke Exp $
Author:
Jorg Janke, Teo Sarca, www.arhipac.ro
  • BF [ 1757523 ] Server Processes are using Server's context
  • FR [ 2214883 ] Remove SQL code and Replace for Query
  • See Also:
    • Constructor Details

      • MProcess

        public MProcess(Properties ctx, String AD_Process_UU, String trxName)
        UUID based Constructor
        Parameters:
        ctx - Context
        AD_Process_UU - UUID key
        trxName - Transaction
      • MProcess

        public MProcess(Properties ctx, int AD_Process_ID, String trxName)
        Standard Constructor
        Parameters:
        ctx - context
        AD_Process_ID - process
        trxName - transaction name
      • MProcess

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

        public MProcess(MProcess copy)
        Copy constructor
        Parameters:
        copy -
      • MProcess

        public MProcess(Properties ctx, MProcess copy)
        Copy constructor
        Parameters:
        ctx -
        copy -
      • MProcess

        public MProcess(Properties ctx, MProcess copy, String trxName)
        Copy constructor
        Parameters:
        ctx -
        copy -
        trxName -
    • Method Details

      • get

        public static MProcess get(int AD_Process_ID)
        Get MProcess from Cache (immutable)
        Parameters:
        AD_Process_ID - id
        Returns:
        MProcess
      • get

        public static MProcess get(Properties ctx, int AD_Process_ID)
        Get MProcess from Cache (immutable)
        Parameters:
        ctx - context
        AD_Process_ID - id
        Returns:
        MProcess
      • getCopy

        public static MProcess getCopy(Properties ctx, int AD_Process_ID, String trxName)
        Get updateable copy of MProcess from cache
        Parameters:
        ctx -
        AD_Process_ID -
        trxName -
        Returns:
        MProcess
      • get

        public static MProcess get(String AD_Process_UU)
        Get MProcess from Cache based on UUID (immutable)
        Parameters:
        AD_Process_UU - UUID
        Returns:
        MProcess
      • get

        public static MProcess get(Properties ctx, String AD_Process_UU)
        Get MProcess from Cache based on UUID (immutable)
        Parameters:
        ctx - context
        AD_Process_UU - UUID
        Returns:
        MProcess
      • getFromMenu

        public static MProcess getFromMenu(Properties ctx, int AD_Menu_ID)
        Get MProcess from Menu
        Parameters:
        ctx - context
        AD_Menu_ID - id
        Returns:
        MProcess or null
      • getParameters

        public MProcessPara[] getParameters()
        Get Process Parameters
        Returns:
        process parameters
      • getParameter

        public MProcessPara getParameter(String name)
        Get Process Parameter with ColumnName
        Parameters:
        name - column name
        Returns:
        process parameter or null
      • toString

        public String toString()
        String Representation
        Overrides:
        toString in class X_AD_Process
        Returns:
        info
      • processIt

        @Deprecated public MPInstance processIt(int Record_ID, Trx trx)
        Deprecated.
        Process w/o parameter
        Parameters:
        Record_ID - record
        trx - transaction
        Returns:
        Process Instance
      • processIt

        @Deprecated public MPInstance processIt(int Record_ID, Trx trx, boolean managedTrx)
        Deprecated.
        Process w/o parameter
        Parameters:
        Record_ID - record
        trx - transaction
        Returns:
        Process Instance
      • processIt

        public boolean processIt(ProcessInfo pi, Trx trx)
        Parameters:
        pi - Process Info
        trx - transaction
        Returns:
        true if OK
      • processIt

        public boolean processIt(ProcessInfo pi, Trx trx, boolean managedTrx)
        Execute the process
        Parameters:
        pi - Process Info
        trx - transaction
        managedTrx - true to manage commit and rollback
        Returns:
        true if OK
      • isJavaProcess

        public boolean isJavaProcess()
        Is this using Java Process
        Returns:
        true if this is using java process
      • isDatabaseProcedure

        public boolean isDatabaseProcedure()
        Is this using DB procedure
        Returns:
        true if this is using DB procedure
      • isForceBackground

        public boolean isForceBackground()
        Is Force running in Background
        Returns:
        true if force to run in background
      • isForceForeground

        public boolean isForceForeground()
        Is Force running Foreground
        Returns:
        true if force to run in foreground
      • isWorkflow

        public boolean isWorkflow()
        Is it a Workflow process
        Returns:
        true if this is a Workflow process
      • addStatistics

        @Deprecated public void addStatistics(int seconds)
        Deprecated.
        - use UPDATE instead
        Update Statistics
        Parameters:
        seconds - sec
      • afterSave

        protected boolean afterSave(boolean newRecord, boolean success)
        After Save
        Overrides:
        afterSave in class PO
        Parameters:
        newRecord - new
        success - success
        Returns:
        success
      • getProcess_ID

        public static int getProcess_ID(String value, String trxName)
        Get AD_Process_ID via Value (Search key)
        Parameters:
        value - AD_Process.Value
        trxName -
        Returns:
        AD_Process_ID
      • copyFrom

        public void copyFrom(MProcess source)
        Copy values and parameters from another process and saves. Not overwritten: name, value, entitytype.
        Parameters:
        source -
      • processItWithoutTrxClose

        public boolean processItWithoutTrxClose(ProcessInfo pi, Trx trx)
        Execute process without closing the given transaction - used from workflow engine.
        Parameters:
        pi - Process Info
        trx - transaction
        Returns:
        true if OK
      • markImmutable

        public MProcess markImmutable()
        Description copied from interface: ImmutablePOSupport
        mark PO as immutable
        Specified by:
        markImmutable in interface ImmutablePOSupport
        Returns:
        PO
      • beforeSave

        protected boolean beforeSave(boolean newRecord)
        Called before Save for Pre-Save Operation
        Overrides:
        beforeSave in class PO
        Parameters:
        newRecord - new record
        Returns:
        true if record can be saved