Table of Contents

Search

  1. Preface
  2. RulePoint Interfaces
  3. RulePoint Services
  4. Custom Service API
  5. Java Adapter for REST API
  6. RulePoint REST API
  7. Sample XML and JSON Requests and Responses
  8. RulePoint Pluggable Authentication Module
  9. HTTP Request and Response Attributes

Developer Guide

Developer Guide

Creating a Custom Analytic Service

Creating a Custom Analytic Service

  1. Extend the custom analytic class from the com.informatica.cep.sdk.service.api.AbstractPluggableAnalytic abstract class.
  2. Mark the abstract class with @Service annotation with serviceType as ServiceType.ANALYTIC.
    The following code is an example of an analytic class that extends the AbstractPluggableAnalytic class:
    @Service(name="getanalytic", displayName="Get Analytic", description="Custom get analytic", configClassName="com.informatica.sdk.samples.analytics.GetAnalytic", connectionTypeName ="cacheconnection", serviceType=ServiceType.ANALYTIC) public class GetAnalytic extends AbstractPluggableAnalytic {
  3. Implement the following methods to write a custom analytic:
    • com.informatica.cep.sdk.service.AbstractPluggableAnalytic.configure(Properties): The ServiceController framework calls the configured property-values of the analytic during deployment.
    • com.informatica.sdk.samples.analytics.GetAnalytic.isSystem(): This method must return whether the analytic is a system analytic. If the method returns true, this analytic is considered as a non-configurable analytic. If the method returns false, the analytic appears in the analytic creation user interface and the user can create instances of it.
      Overriding isSystem(): @Override public boolean isSystem() { return false; }
    • com.informatica.cep.sdk.service.AbstractAnalytic.destroy(): This method must provide cleanup logic only for the analytic. If this analytic uses a custom connection, you cannot destroy or clean up the connection. The destroy method for the connection is a part of connection undeployment.
    • com.informatica.cep.sdk.Analytic.analyze(List<Object>): This method provides the actual evaluation logic for the analytic, which optionally uses a connection if needed. The List<Object> passed is the list of arguments that the analytic takes. The type of elements in this list depends on how it is being used in the rule. The return value is usually a string or a list of strings if the analytic returns multiple values. It can also be a list of objects. Hence, the return type is left open.
    • com.informatica.cep.sdk.Analytic.isUnary(): This method returns whether the analytic can be used in a condition. If it returns true, you cannot use the analytic directly in a condition, but you can use it as a Boolean expression.
    The configured analytic appears in the list in the corresponding page of the user interface.

0 COMMENTS

We’d like to hear from you!