Class MethodCondition

java.lang.Object
jadex.rules.eca.MethodCondition
All Implemented Interfaces:
ICondition

public class MethodCondition extends Object implements ICondition
Condition implementation that invokes a predefined method.
  • Field Details

    • object

      protected Object object
      The object.
    • method

      protected Method method
      The method.
    • invert

      protected boolean invert
      The invert flag. Inverts method result.
    • guesser

      protected jadex.common.IMethodParameterGuesser guesser
      The parameter guesser.
  • Constructor Details

    • MethodCondition

      public MethodCondition(Object object, Method method)
      Create a new method condition.
    • MethodCondition

      public MethodCondition(Object object, Method method, jadex.common.IMethodParameterGuesser guesser)
      Create a new method condition.
    • MethodCondition

      public MethodCondition(Object object, Method method, boolean invert)
      Create a new method condition.
    • MethodCondition

      public MethodCondition(Object object, Method method, boolean invert, jadex.common.IMethodParameterGuesser guesser)
      Create a new method condition.
  • Method Details

    • evaluate

      public jadex.future.IFuture<jadex.common.Tuple2<Boolean,Object>> evaluate(IEvent event)
      Evaluate the condition.
      Specified by:
      evaluate in interface ICondition
      Parameters:
      event - The event.
      Returns:
      True, if condition is met (plus additional user data).
    • invokeMethod

      protected Object invokeMethod(IEvent event) throws Exception
      Do the method invocation.
      Throws:
      Exception