Class TextItemValueAdapter

java.lang.Object
org.imixs.workflow.engine.TextItemValueAdapter

public class TextItemValueAdapter extends Object
The TextItemValueAdapter replaces text fragments with the values of a named Item.
Author:
rsoika
  • Constructor Details

    • TextItemValueAdapter

      public TextItemValueAdapter()
  • Method Details

    • onEvent

      public void onEvent(@Observes TextEvent event)
      This method reacts on CDI events of the type TextEvent and parses a string for xml tag [<itemvalue>. Those tags will be replaced with the corresponding item value:

      hello <itemvalue>$Creator</itemvalue>

      Item values can also be formated. e.g. for date/time values:

      Last access Time= <itemvalue format="mm:ss">$created</itemvalue>

      If the itemValue is a multiValue object the single values can be spearated by a separator:

      Phone List: <itemvalue separator="<br />">txtPhones</itemvalue>

    • formatItemValues

      public String formatItemValues(List<?> aItem, String aSeparator, String sFormat, Locale locale, String sPosition)
      This method returns a formated a string object. In case a Separator is provided, multiValues will be separated by the provided separator. If no separator is provide, only the first value will returned. The format and locale attributes can be used to format number and date values.
    • formatItemValues

      public String formatItemValues(List<?> aItem, String aSeparator, String sFormat)
      this method formats a string object depending of an attribute type. MultiValues will be separated by the provided separator
    • formatItemValues

      public String formatItemValues(List<?> aItem, String aSeparator, String sFormat, Locale alocale)
      this method formats a string object depending of an attribute type. MultiValues will be separated by the provided separator