Interface BusinessAlgorithm


public interface BusinessAlgorithm
This interface should be used to create custom BusinessAlgorithms for use in calculated attributes. To invoke your BusinessAlgoithm in your calculated attribute in the type manager, in the formula property, enter a formula like: execute("com.mycompany.MyBusinessAlgorithm", arg1, arg2, arg3) com.mycompany.MyBusinessAlgorithm is a class that implements this interface and arg1, arg2, arg3 are arguments to pass to the class. Classes implementing this interface must be public and must provide a no argument constructor

Supported API: true

Extendable: true
  • Method Summary

    Modifier and Type
    Method
    Description
    This method should perform the desired calculation for your BusinessAlgorithm and return the final result

    Supported API: true

    Extendable: true
    This API provides a fake result for formula validation.
  • Method Details

    • execute

      Object execute(BusinessAlgorithmContext context, Object[] args)
      This method should perform the desired calculation for your BusinessAlgorithm and return the final result

      Supported API: true

      Extendable: true
      Parameters:
      context - the context can be used to share information between invocations of the BusinessAlgorithm on different objects within the current set. BusinessAlgorithmContext
      args - An Arbitrary set of arguments, your algorithm will receive the arguments that were configured in the type manager in this array.
      Returns:
      the result of the calculation
    • getSampleValue

      Object getSampleValue()
      This API provides a fake result for formula validation. Since the BusinessAlgorithms can be expensive to execute and require a lot of other data that cannot be faked for formula validation it is necessary to avoid attempting to run the algorithms at formula validation time. This API should return the same type of object as execute will return and that object should represent a realistic return value for execute. This value will be used only in the type manager at formula validation time to ensure that the dataype returned by this BusinessAlgorithm will work in the formula it is being executed from.

      Supported API: true

      Extendable: true