Interface IndicatorOperations


  • public interface IndicatorOperations
    Provides indicator execution operations for the EBX™ Insight Add-on. These operations must be called within different EBX contexts, such as: user service, script/user task and trigger.

    All the indicator execution operations require a configured indicator for a dedicated EBX entity (dataspace, dataset, table, record, workflow, etc.).

    Code sample

     public class UserServiceExecuteAnIndicator implements UserService<TableViewEntitySelection> {
    
        @Override
         public void setupDisplay(UserServiceSetupDisplayContext<TableViewEntitySelection> context, UserServiceDisplayConfigurator configurator) {
             // an EBX session from the user service context
             Session session = context.getSession();
    
             //get an instance of indicator execution operations
             IndicatorOperations indicatorOperations = OperationsFactory.getInstance().getIndicatorOperations(session);
    
             try {
                 //execute an indicator based on it's uuid
                 IndicatorExecution indicatorExecution = indicatorOperations.execute("AERC-1234-AHFD-4532");
    
                 //returns a list of executions results for a given indicator
                 List<IndicatorExecutionResult> results = indicatorExecution.getIndicatorExecutionResults();
    
                 //returns all the executions associated with a given indicator. It's possible to order those execution from ascendant or descendant order
                 QueryParam qp = new QueryParam();
                 qp.setOrderByExecutionDate(Order.ASC);
                 List<IndicatorExecution> indicatorExecutionResults = indicatorOperations.getIndicatorExecutions("AERC-1234-AHFD-4532", qp);
    
                 // returns the last execution of the given indicator
                 IndicatorExecution indicatorLastExecution = indicatorOperations.getLastIndicatorExecution("AERC-1234-AHFD-4532");
    
             } catch (DPRAException e) {
                 e.printStackTrace();
             }
         }
     }
     
    Since:
    4.2.0
    • Method Detail

      • execute

        IndicatorExecution execute​(java.lang.String indicatorId)
                            throws DPRAException

        executes an indicator

        Parameters:
        indicatorId - an indicator UUID
        Returns:
        the information of an indicator execution
        Throws:
        DPRAException - when the indicator does not exist or the UUID indicated contains some typos
      • getIndicatorExecutions

        java.util.List<IndicatorExecution> getIndicatorExecutions​(java.lang.String indicatorId,
                                                                  QueryParam queryParam)
                                                           throws DPRAException

        Returns all the executions associated with a given indicator. It's possible to order the executions in ascending or descending order.

        Parameters:
        indicatorId - an indicator UUID
        queryParam - a DPRA query param
        Returns:
        List the information of an indicator execution
        Throws:
        DPRAException - when the indicator does not exist or the UUID indicated contains a typo
      • getLastIndicatorExecution

        IndicatorExecution getLastIndicatorExecution​(java.lang.String indicatorId)
                                              throws DPRAException

        Returns the last execution of the given indicator

        Parameters:
        indicatorId - an indicator UUID
        Returns:
        IndicatorExecution the last execution of the given indicator
        Throws:
        DPRAException - when the indicator does not exist or the UUID indicated contains a typo