Class CalloutEngine

java.lang.Object
org.compiere.model.CalloutEngine
All Implemented Interfaces:
Callout
Direct Known Subclasses:
Callout_AD_Column, Callout_AD_Process_Para, CalloutAddressValidation, CalloutAssignment, CalloutBankAcctProcessor, CalloutBankStatement, CalloutBOM, CalloutBPartnerLocation, CalloutCashJournal, CalloutClient, CalloutFillLocator, CalloutGLJournal, CalloutImportTemplate, CalloutInOut, CalloutInventory, CalloutInvoice, CalloutInvoiceBatch, CalloutMovement, CalloutOpportunity, CalloutOrder, CalloutPackage, CalloutPayment, CalloutPaymentAllocate, CalloutPaySelection, CalloutProcessCustomization, CalloutProductCategory, CalloutProduction, CalloutProject, CalloutRequest, CalloutRequisition, CalloutRMA, CalloutShipper, CalloutShippingProcessor, CalloutTaxProvider, CalloutTimeExpense, CalloutWindowCustomization, MAssetType.Callout

public class CalloutEngine extends Object implements Callout
Callout Engine. Default implementation of Callout interface using Java reflection.
Version:
$Id: CalloutEngine.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $
Author:
Jorg Janke, Teo Sarca, SC ARHIPAC SERVICE SRL
  • BF [ 2104021 ] CalloutEngine returns null if the exception has null message
    • Field Details

      • NO_ERROR

        public static final String NO_ERROR
        No error return value. Use this when you are returning from a callout without error
        See Also:
      • log

        protected CLogger log
        Logger
      • additionalArgs

        protected String[] additionalArgs
      • ARG_SEPARATOR

        public static final String ARG_SEPARATOR
        See Also:
    • Constructor Details

      • CalloutEngine

        public CalloutEngine()
        Constructor
    • Method Details

      • start

        public String start(Properties ctx, String methodName, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue)
        Start Callout.

        Callout's are used for field validation, cross field validation and setting values in other fields. When returning a non empty (error message) string, an exception is raised.

        When invoked, the Tab model has the new value!

        Specified by:
        start in interface Callout
        Parameters:
        ctx - Context
        methodName - Method name
        WindowNo - current Window No
        mTab - Model Tab
        mField - Model Field
        value - The new value
        oldValue - The old value
        Returns:
        Error message or ""
      • convert

        public String convert(String methodAndArgs, String value)
        Conversion Rules. Use by ImpFormatRow to convert an input value.
        Specified by:
        convert in interface Callout
        Parameters:
        methodAndArgs - method name and additional arguments (in brackets, separated by commas)
        value - the value
        Returns:
        converted String or Null if no method found
      • isCalloutActive

        protected boolean isCalloutActive()
        Is the current callout being called in the middle of another callout doing her works.
        Callout can use GridTab.getActiveCalloutInstance() method to find out callout for which field is running.
        Returns:
        true if active
      • setCalloutActive

        protected static void setCalloutActive(boolean active)
        Deprecated.
        Set Callout (in)active. Depreciated as the implementation is not thread safe and fragile - break other callout if developer forget to call setCalloutActive(false) after calling setCalloutActive(true).
        Parameters:
        active - active
      • dateAcct

        public String dateAcct(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value)
        Set Account Date Value. org.compiere.model.CalloutEngine.dateAcct
        Parameters:
        ctx - context
        WindowNo - window no
        mTab - tab
        mField - field
        value - value
        Returns:
        null or error message
      • checkPeriodOpen

        public String checkPeriodOpen(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value)
        Check Account Date is on a opened period
        Parameters:
        ctx - context
        WindowNo - window no
        mTab - tab
        mField - field
        value - value
        Returns:
        null or error message
      • rate

        public String rate(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value)
        Rate - set Multiply Rate from Divide Rate and vice versa org.compiere.model.CalloutEngine.rate
        Parameters:
        ctx - context
        WindowNo - window no
        mTab - tab
        mField - field
        value - value
        Returns:
        null or error message
      • getGridTab

        public GridTab getGridTab()
        Returns:
        gridTab
      • getGridField

        public GridField getGridField()
        Returns:
        gridField