Class CalloutEngine

    • Constructor Detail

      • CalloutEngine

        public CalloutEngine()
        Constructor
    • Method Detail

      • 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 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. Convert a String
        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