Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.fujitsu.iflow.model.workflow
Interface VotingRule

public interface VotingRule

This interface is used to specify the voting rule of a `Node` object of type `Node.TYPE_VOTING_ACTIVITY`.

A `VotingRule` object specifies the voting rule of one outgoing arrow of the corresponding node using the following attributes: Arrow Name, Voting Rule Type and Threshold.

The Arrow Name identifies the outgoing arrow for which the voting rule is defined. The Voting Rule Type defines the kind of controls to be used for voting. The possible voting rules are specified in this interface by constants such as `TYPE_MAJORITY`. The Threshold of a voting rule defines the limit when the condition becomes true. The threshold is ignored when the Voting Rule Type is `TYPE_MAJORITY`.

See Also:
  `Node`, `Arrow`

Field Summary
`static int` | `TYPE_MAJORITY` Indicates that the type of voting is majority.
`static int` | `TYPE_NUMBER` Indicates that this voting rule is applied when a specified number of users selected this choice (arrow).
`static int` | `TYPE_PERCENTAGE` Indicates that the voting depends on the percentage.

Method Summary
`java.lang.String` | `getArrowName()` Returns the name of the outgoing arrow of the node to which this voting rule belongs.
`int` | `getThreshold()` Returns the threshold of this voting rule.
`int` | `getVotingRuleType()` Returns the current type of this voting rule as defined by a constant such as `TYPE_MAJORITY`.

Field Detail

### TYPE_MAJORITY

    public static final int TYPE_MAJORITY

  Indicates that the type of voting is majority. This means that this voting rule is applied if more than 50% of the voting users select this choice.

  See Also:
    Constant Field Values

### TYPE_PERCENTAGE

    public static final int TYPE_PERCENTAGE

  Indicates that the voting depends on the percentage. This means that this voting rule is applied if the defined percentage of votes is reached.

  See Also:
    Constant Field Values

### TYPE_NUMBER

    public static final int TYPE_NUMBER

  Indicates that this voting rule is applied when a specified number of users selected this choice (arrow).

  See Also:
    Constant Field Values

Method Detail

### getVotingRuleType

    public int getVotingRuleType()
                          throws ModelException

  Returns the current type of this voting rule as defined by a constant such as `TYPE_MAJORITY`.

  Per default the voting rule is defined as `TYPE_MAJORITY`.

  Returns:
    The integer constant specifying the type of this voting rule.
  Throws:
    `ModelException`

### getThreshold

    public int getThreshold()
                     throws ModelException

  Returns the threshold of this voting rule. The threshold depends on the type of this voting rule.
  - `TYPE_NUMBER`. The returned threshold is the minimum number of users that must select this voting rule arrow.
  - `TYPE_PERCENTAGE`. The returned threshold is the minimum percentage of users, that must select this voting rule arrow.
  - `TYPE_MAJORITY`. The threshold is ignored, because the voting rule becomes true when the majority of users selects this voting rule arrow.

  Returns 0 if no threshold is defined.

  Returns:
    The current threshold of this voting rule.
  Throws:
    `ModelException`

### getArrowName

    public java.lang.String getArrowName()
                                  throws ModelException

  Returns the name of the outgoing arrow of the node to which this voting rule belongs. This `VotingRule` object specifies the voting rule of the returned arrow.

  The arrow name is specified with the initialisation of the `VotingRule`.

  Returns:
    Name of arrow this `VotingRule` specifies.
  Throws:
    `ModelException`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD