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 BranchSpec

public interface BranchSpec

The `BranchSpec` interface defines the rules that define a specific branch in a `ConditionSpec`. A `ConditionSpec`, which is associated with a `node` of the type `TYPE_CONDITION`, consists of one `BranchSpec` object for each of the arrows that exit it.

A `BranchSpec` stores a condition. When the condition is met, the process instance proceeds along the path of the arrow that the `BranchSpec` is associated with.

The condition is met if the design-time value specified on the `BranchSpec` and the run-time value of the User Defined Attribute (UDA), specified in the `ConditionSpec`, satisfy the operator.

The `BranchSpec` consists of the following attributes: Comparison operator, Arrow name, Value and whether it is the default one or not. Possible operators are:

- EQUAL_OP
- NOT_EQUALS_OP
- LESS_THAN_OP
- LESS_THAN_OR_EQUAL_OP
- GREATER_THAN_OP
- GREATER_THAN_OR_EQUAL_OP

The Arrow name attribute identifies the `Arrow` the `BranchSpec` is associated with. The Value attribute is defined at design-time and defines combined with the operator, the condition of this branch.

If a `BranchSpec` represents the default branch, the process instance will proceed along the associated arrow if no `BranchSpec` meets the specified condition.

The standard way of constructing a new `BranchSpec` object is to call the method `ConditionSpec.setCondBranchSpecInfo`. This one creates a new `BranchSpec` with the general attributes of a branch.

`String` parameters of all methods in this class have a length limit. This limit is documented in the Javadoc comment for every parameter. If the length of a value supplied for such a parameter exceeds this limit or the value is `null`, an exception is thrown. This exception is a subclass of `ModelException`. For future compatibility, only `ModelException` should be caught explicitly.

If the signature of a method does not allow throwing any exception, any value supplied to this method that exceeds the length limit is truncated to the maximum length supported. `null` values are ignored in this case. Any method’s behaviour that differs from the behaviour described above is explained in this method’s Javadoc comment.

See Also:
  `ConditionSpec`, `Arrow`, `Node`, `DataItem`

Field Summary
`static int` | `EQUAL_OP` This operator determines whether a dynamic data value is equal to the stored data value.
`static int` | `GREATER_THAN_OP` This operator determines whether a dynamic data value is greater than the stored data value.
`static int` | `GREATER_THAN_OR_EQUALS_OP` This operator determines whether a dynamic data value is greater than or equal to the stored data value.
`static int` | `LESS_THAN_OP` This operator determines whether a dynamic data value is less than the stored data value.
`static int` | `LESS_THAN_OR_EQUALS_OP` This operator determines whether a dynamic data value is less than or equal to the stored data value.
`static int` | `NOT_EQUALS_OP` This operator determines whether a dynamic data value and the stored data value are unequal.

Method Summary
`java.lang.String` | `getArrowLabel()` Returns the label of the arrow that this branch represents.
`int` | `getComparisonOperator()` Returns the current comparison operator of this branch as defined in the `BranchSpec` interface by constants such as `EQUAL_OP`.
`java.lang.String` | `getValue()` Returns the initial data value stored in this branch as a `String`.
`boolean` | `isDefault()` Determines whether this branch is the default one.
`void` | `setArrowLabel(java.lang.String label)` Associates the arrow specified by the label with this branch.
`void` | `setComparisonOperator(int comparisonOperator)` Specifies a comparison operator in this branch.
`void` | `setDefault(boolean isDefault)` Sets this branch to be the default.
`void` | `setValue(java.lang.String value)` Specifies a static data value in this branch.

Field Detail

### EQUAL_OP

    public static final int EQUAL_OP

  This operator determines whether a dynamic data value is equal to the stored data value.

  See Also:
    Constant Field Values

### NOT_EQUALS_OP

    public static final int NOT_EQUALS_OP

  This operator determines whether a dynamic data value and the stored data value are unequal.

  See Also:
    Constant Field Values

### LESS_THAN_OP

    public static final int LESS_THAN_OP

  This operator determines whether a dynamic data value is less than the stored data value.

  See Also:
    Constant Field Values

### LESS_THAN_OR_EQUALS_OP

    public static final int LESS_THAN_OR_EQUALS_OP

  This operator determines whether a dynamic data value is less than or equal to the stored data value.

  See Also:
    Constant Field Values

### GREATER_THAN_OP

    public static final int GREATER_THAN_OP

  This operator determines whether a dynamic data value is greater than the stored data value.

  See Also:
    Constant Field Values

### GREATER_THAN_OR_EQUALS_OP

    public static final int GREATER_THAN_OR_EQUALS_OP

  This operator determines whether a dynamic data value is greater than or equal to the stored data value.

  See Also:
    Constant Field Values

Method Detail

### setComparisonOperator

    public void setComparisonOperator(int comparisonOperator)

  Specifies a comparison operator in this branch. The parameter must be one of the constants defined in the `BranchSpec` interface such as `EQUAL_OP`.

  The process definition must be in edit-mode before calling `setComparisonOperator`. Edit-mode is entered by calling `Plan.startEdit`. If this method is called to modify `BranchSpec` within a running process instance, also the process instance must be in structural edit-mode. Edit-mode is entered by calling `ProcessInstance.startStructuralEdit`. When not in edit-mode, calling this method will have no effect.

  Parameters:
    `comparisonOperator` - The Integer constant specifying the current comparison operator in this branch.
  See Also:
    `Plan.startEdit()`, `ProcessInstance.startStructuralEdit()`

### getComparisonOperator

    public int getComparisonOperator()

  Returns the current comparison operator of this branch as defined in the `BranchSpec` interface by constants such as `EQUAL_OP`.

  The comparison operator is set with initialisation of the `BrachSpec` object. It can be changed by calling method `setComparisonOperator`.

  Returns:
    The Integer constant specifying the current comparison operator of this User Defined Attribute.
  See Also:
    `setComparisonOperator(int)`

### getValue

    public java.lang.String getValue()

  Returns the initial data value stored in this branch as a `String`.

  The value is set with initialisation of the `BrachSpec` object. It can be changed by calling method `setValue`.

  Returns:
    The value of this branch.
  See Also:
    `setValue(String)`

### setValue

    public void setValue(java.lang.String value)

  Specifies a static data value in this branch. This method is used at design-time to set up a static value to compare with a run-time value, stored in a User Defined Attribute when evaluating a condition.

  The process definition must be in edit-mode before calling `setValue`. Edit-mode is entered by calling `Plan.startEdit`. If this method is called to modify `BranchSpec` within a running process instance, also the process instance must be in structural edit-mode. Edit-mode is entered by calling `ProcessInstance.startStructuralEdit`. When not in edit-mode, calling this method will have no effect.

  Parameters:
    `value` - The value for compare with a run-time value.
  See Also:
    `Plan.startEdit()`, `ProcessInstance.startStructuralEdit()`

### getArrowLabel

    public java.lang.String getArrowLabel()

  Returns the label of the arrow that this branch represents.

  The arrow label is specified with initialisation of the `BrachSpec` object. It can be changed by calling method `setArrowLabel`.

  Returns:
    Name of arrow this branch represents.
  See Also:
    `setArrowLabel(String)`

### setArrowLabel

    public void setArrowLabel(java.lang.String label)

  Associates the arrow specified by the label with this branch. The name of an arrow is a unique identifier to specify the outgoing arrows of a node.

  The name must not be longer than specified in `Arrow.MAX_ARROW_NAME_LENGTH`.

  The process definition must be in edit-mode before calling `setArrowLabel`. Edit-mode is entered by calling `Plan.startEdit`. If this method is called to modify `BranchSpec` within a running process instance, also the process instance must be in structural edit-mode. Edit-mode is entered by calling `ProcessInstance.startStructuralEdit`. When not in edit-mode, calling this method will have no effect.

  Parameters:
    `label` - Name of arrow this branch represents.
  See Also:
    `Plan.startEdit()`, `ProcessInstance.startStructuralEdit()`

### setDefault

    public void setDefault(boolean isDefault)

  Sets this branch to be the default. If none of the conditions specified in the condition node are satisfied, the default branch is the one taken.

  The process definition must be in edit-mode before calling `setDefault`. Edit-mode is entered by calling `Plan.startEdit`. If this method is called to modify `BranchSpec` within a running process instance, also the process instance must be in structural edit-mode. Edit mode is entered by calling `ProcessInstance.startStructuralEdit`. When not in edit-mode, calling this method will have no effect.

  Parameters:
    `isDefault` - `True` to specify this branch as default one; `false` otherwise.
  See Also:
    `Plan.startEdit()`, `ProcessInstance.startStructuralEdit()`

### isDefault

    public boolean isDefault()

  Determines whether this branch is the default one.

  Returns:
    `True` if this branch is the default one; `false` otherwise.

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