Interface ClassificationService


public interface ClassificationService
Main interface for performing classifications.
  • Field Details

  • Method Details

    • getService

      static ClassificationService getService()
      Returns an instance of ClassificationService.
      Returns:
      an instance of this service class.
    • registerClassifier

      void registerClassifier(Class<? extends Classifier> classifierClass)
      Registers a new Classifier implementation with the given name.
      Parameters:
      classifierClass - the implementation class of the registered classifier
    • registerField

      void registerField(Class<? extends ProcessField> fieldClass)
      Registers a new ProcessField implementation.
      Parameters:
      fieldClass - the implementation class of the registered field
    • build

      EvaluationResult build(String classifierAssignmentName, ProcessDefinition process)
      Builds the classifier of specified classifier assignment of the passed process.
      Parameters:
      classifierAssignmentName - the name of the classifier assignment which classifier shall be build
      process - the process definition of the classifier assignment
      Returns:
      the evaluation result of the building process
    • evaluate

      EvaluationResult evaluate(String classifierAssignmentName, ProcessDefinition process)
      Evaluates the classifier of specified classifier assignment of the passed process.
      Parameters:
      classifierAssignmentName - the name of the classifier assignment which classifier shall be evaluated
      process - the process definition of the classifier assignment
      Returns:
      the result of the evaluation
    • classify

      <T> ClassificationResult<T> classify(String classifierAssignmentName, ActivityInstance activityInstance)
      Classifies the given activity instance using the classifier of the specified classifier assignment
      Parameters:
      classifierAssignmentName - the name of the classifier assignment which classifier shall be taken for the classification
      activityInstance - the activity instance which shall be classified
      Returns:
      the highest ranked result of the classification
    • classifications

      <T> List<ClassificationResult<T>> classifications(String classifierAssignmentName, ActivityInstance activityInstance)
      Classifies the given activity instance using the classifier of the specified classifier assignment
      Parameters:
      classifierAssignmentName - the name of the classifier assignment which classifier shall be taken for the classification
      activityInstance - the activity instance which shall be classified
      Returns:
      a list of classification result for each class supported by the classifier
    • executeClassification

      boolean executeClassification(String classifierAssignmentName, ActivityInstance activityInstance, double minimumProbability)
      Executes a classification for the given activity instance using the classifier of the specified classifier assignment defined for the process definition of the passed activity instance, i.e. the classification is performed and the result is stored in the field defined as output field in that classifier assignment. If a minimum probability is specified an automatic storage of the result in the output field will only be performed if the probability of the classification result is greater or equals to that minimum probability. If ZERO_PROBABILITY is passed storage will be performed in any case.
      Parameters:
      classifierAssignmentName - the name of the classifier assignment which classifier shall be taken for the classification
      activityInstance - the activity instance which shall be classified
      minimumProbability - the minimum classification probability that must be met to trigger automatic storage
      Returns:
      true if the form has been changed, false otherwise (which means that the field of the form already had the value of the performed classification or the classification did not meet the minimum probability)
    • executeClassifications

      boolean executeClassifications(ActivityInstance activityInstance, double minimumProbability)
      Executes classifications for the given activity instance using all classifier assignment defined for the process definition of the passed activity instance, i.e. the classifications are performed and their results are stored in the fields defined as output fields in the various classifier assignments. If a minimum probability is specified automatic storage of the results in the output fields will only be performed for those classifications which probability of the classification result is greater or equals to that minimum probability. If ZERO_PROBABILITY is passed storage will be performed in any case.
      Parameters:
      activityInstance - the activity instance which shall be classified
      minimumProbability - the minimum classification probability that must be met to trigger automatic storage
      Returns:
      true if the form has been changed by any of the executed classifications, false otherwise