Class WfTally

java.lang.Object
wt.workflow.work.WfTally
All Implemented Interfaces:
Externalizable, Serializable

public class WfTally extends Object implements Externalizable
Public static class to abstract heinous tally expressions.

Supported API: true

Extendable: false
See Also:
  • Method Details

    • any

      public static String any(ObjectReference self, String event1, String event2) throws WfException
      This API returns "event1", if even one user voted for "event1", else "event2" is returned.

      Supported API: true
      Parameters:
      self -
      event1 -
      event2 -
      Returns:
      String
      Throws:
      WfException
    • any

      public static Vector any(ObjectReference self, Vector events) throws WfException
      This API returns all the events that any of the user selected, and which are also present in input parameter "events"

      Supported API: true
      Parameters:
      self -
      events -
      Returns:
      Vector
      Throws:
      WfException
    • all

      public static String all(ObjectReference self, String event1, String event2) throws WfException
      This API returns "event1", only if all users selected "event1", else returns "event2"

      Supported API: true
      Parameters:
      self -
      event1 -
      event2 -
      Returns:
      String
      Throws:
      WfException
    • all

      public static Vector all(ObjectReference self, Vector events) throws WfException
      This API return collection of all the event that are selected by all users and which are also present in input parameter "events".

      Supported API: true
      Parameters:
      self -
      events -
      Returns:
      Vector
      Throws:
      WfException
    • plurality

      public static String plurality(ObjectReference self, String event1, String event2) throws WfException
      If number of votes received by "event1" is highest, return "event1". Else returns "event2"

      Supported API: true
      Parameters:
      self -
      event1 -
      event2 -
      Returns:
      String
      Throws:
      WfException
    • plurality

      public static Vector plurality(ObjectReference self, Vector events) throws WfException
      All those event that received highest number of votes, and which are also part of input parameter "events", are returned in the collection. If there are two events that have received highest vote, then both these events are returned in the collection.

      Supported API: true
      Parameters:
      self -
      events -
      Returns:
      Vector
      Throws:
      WfException
    • notPlurality

      public static String notPlurality(ObjectReference self, String event1, String event2) throws WfException
      If number of votes received by "event1" is not highest, return "event1". Else return "event2"

      Supported API: true
      Parameters:
      self -
      event1 -
      event2 -
      Returns:
      String
      Throws:
      WfException
    • notPlurality

      public static Vector notPlurality(ObjectReference self, Vector events) throws WfException
      Events that did not receive highest number of votes, and that are also part of input parameter "events", are added in the returned collection.

      Supported API: true
      Parameters:
      self -
      events -
      Returns:
      Vector
      Throws:
      WfException
    • percent

      public static String percent(ObjectReference self, String operator, int value, String event1, String event2) throws WfException
      Percent calc=(Total no. of votes for event1/Total votes)*100 Suppose operator: > and value =100. Then only if percent calc > 100, return "event1". Else return "event2".

      Supported API: true
      Parameters:
      self -
      operator -
      value -
      event1 -
      event2 -
      Returns:
      String
      Throws:
      WfException
    • percent

      public static Vector percent(ObjectReference self, String operator, int value, Vector events) throws WfException
      Percent calc=(Total no. of votes for event/Total votes)*100 Suppose operator: > and value =100 Only if percent calc > 100 for event "e", and "e" is present in input parameter "events" add "e" in the returned collection

      Supported API: true
      Parameters:
      self -
      operator -
      value -
      events -
      Returns:
      Vector
      Throws:
      WfException
    • number

      public static String number(ObjectReference self, String operator, int value, String event1, String event2) throws WfException
      Suppose operator: > and value =2 If number of votes received for event1 > 2, then return event1; else return event2.

      Supported API: true
      Parameters:
      self -
      operator -
      value -
      event1 -
      event2 -
      Returns:
      String
      Throws:
      WfException
    • number

      public static Vector number(ObjectReference self, String operator, int value, Vector events) throws WfException
      Suppose operator: > and value =2. If number of votes received for event > 2, and event is present in input parameter "events" then add this event to returned collection.

      Supported API: true
      Parameters:
      self -
      operator -
      value -
      events -
      Returns:
      Vector
      Throws:
      WfException
    • count

      public static int count(ObjectReference self, String eventToMatch, String assigneeRole, Locale locale) throws WTException
      Supported API: true
      Parameters:
      self - :: WfAssignedActivity Objectreference
      eventToMatch - : routing option/vote user wants to tally.
      assigneeRole - : the role for which user wants to tally routing option.
      locale - : The locale in which user has specified assignee role.
      Returns:
      int : number of votes from the specificed role.
      Throws:
      WTException
    • count

      public static int count(ObjectReference self, String eventToMatch) throws WTException
      Supported API: true
      Parameters:
      self - : WfAssignedActivity Objectreference
      eventToMatch - : routing option/vote user wants to tally.
      Returns:
      int : number of votes from the specificed role.
      Throws:
      WTException