Class AnalyticController

java.lang.Object
org.imixs.workflow.office.forms.AnalyticController
All Implemented Interfaces:
Serializable

@Named @ConversationScoped public class AnalyticController extends Object implements Serializable
The AnalyticController is a conversationScoped controller that provides values for the analytic-custom parts.

A custom implementation can react on AnalyticEvent to compute values and datasets.

The controller implements a caching mechanism to avoid repeated calls for new analytic values. If the analytic value is already stored in the current workitem, no new value will be fired.

Author:
rsoika
See Also:
  • Field Details

    • analyticEvents

      @Inject protected jakarta.enterprise.event.Event<AnalyticEvent> analyticEvents
  • Constructor Details

    • AnalyticController

      public AnalyticController()
  • Method Details

    • getValueAsString

      public String getValueAsString(org.imixs.workflow.ItemCollection workitem, String key, String options)
      Returns a analytic value as a String for a given key.
      Parameters:
      key -
      Returns:
    • getValueAsString

      public String getValueAsString(org.imixs.workflow.ItemCollection workitem, String key)
    • getValueAsJson

      public String getValueAsJson(org.imixs.workflow.ItemCollection workitem, String key, String options)
      Returns a analytic value as a Json String for a given key.
      Parameters:
      key -
      Returns:
    • getValueAsJson

      public String getValueAsJson(org.imixs.workflow.ItemCollection workitem, String key)
    • getValueAsDouble

      public double getValueAsDouble(org.imixs.workflow.ItemCollection workitem, String key, String options)
      Returns a analytic value as a Double for a given key.
      Parameters:
      key -
      Returns:
    • getValueAsDouble

      public double getValueAsDouble(org.imixs.workflow.ItemCollection workitem, String key)
    • getLabel

      public String getLabel(org.imixs.workflow.ItemCollection workitem, String key, String options)
      Returns the analytic label for a given key
      Parameters:
      key -
      Returns:
    • getLabel

      public String getLabel(org.imixs.workflow.ItemCollection workitem, String key)
    • getLink

      public String getLink(org.imixs.workflow.ItemCollection workitem, String key, String options)
      Returns the analytic optional link for a given key
      Parameters:
      key -
      Returns:
    • getLink

      public String getLink(org.imixs.workflow.ItemCollection workitem, String key)
    • getDescription

      public String getDescription(org.imixs.workflow.ItemCollection workitem, String key, String options)
      Returns the analytic description for a given key
      Parameters:
      key -
      Returns:
    • getDescription

      public String getDescription(org.imixs.workflow.ItemCollection workitem, String key)
    • computeValue

      protected org.imixs.workflow.ItemCollection computeValue(org.imixs.workflow.ItemCollection workitem, String key, String options)
      Computes an analytic value. Note: An observer controller is responsible to cache or reset the cached values if needed.
      Parameters:
      key -
      Returns:
    • getOption

      public String getOption(String key, String optionName, String jsonOptions, String defaultValue)
      This helper method returns an optional JSON value from the 'options' attriubte
      Parameters:
      key -
      optionName -
      jsonOptions -
      defaultValue -
      Returns: