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 ConditionSpec

public interface ConditionSpec

The `ConditionSpec` interface allows you to detail the conditional branching in a `node`of the type `TYPE_CONDITION`.``

A condition consists of the name of a User Defined Attribute (UDA) and a group of branches. A branch is represented by the interface `BranchSpec`and is assigned to one of the outgoing `Arrow`s of the `Node` under consideration. At the very least, one branch must exist for each outgoing arrow.``

The order of adding the branches determines the sequence of evaluation at run-time. At run-time, the value of the UDA is evaluated using the defined branches to determine which arrow must be followed to the next node in the workflow.

The standard way to construct a new `ConditionSpec` at design- time is to call the method `Node.getConditionSpec`. To get the assigned condition specification of a node at run-time, call the `NodeInstance.getConditionSpec` method.

`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:
  `BranchSpec`, `Node`, `NodeInstance`, `Arrow`

Method Summary
`BranchSpec` | `addBranchSpec(java.lang.String arrowLabel, int op, java.lang.String value, boolean isDefault)` Deprecated. Replaced by `setCondBranchSpecInfo(java.lang.String, int, java.lang.String, boolean)`.
`BranchSpec` | `getBranchSpec(java.lang.String arrowLabel)` Returns the branch specification that is linked to an arrow whose label is specified as a parameter.
`BranchSpec[]` | `getBranchSpecs()` Deprecated. Replaced by `getEvalOrder()`.
`java.lang.String` | `getConditionAttribute()` Returns the name of the User Defined Attribute (UDA) which is the basis of the branching decision.
`BranchSpec[]` | `getEvalOrder()` Returns an array of all existing branches on this condition specification in the order specified by the `setEvalOrder` method.
`void` | `removeBranchSpec(java.lang.String arrowLabel)` Removes a `BranchSpec` that represents a branch of this condition specification.
`void` | `setCondBranchSpecInfo(java.lang.String arrowLabel, int op, java.lang.String value, boolean isDefault)` Adds a new branch to this `ConditionSpec`, based on the label of an existing arrow.
`void` | `setConditionAttribute(java.lang.String attributeName)` Specifies the User Defined Attribute (UDA) which is the basis of the branching decision.
`void` | `setEvalOrder(BranchSpec[] order)` Stores an ordered array of branches.

Method Detail

### addBranchSpec

    public BranchSpec addBranchSpec(java.lang.String arrowLabel,
                                    int op,
                                    java.lang.String value,
                                    boolean isDefault)

  Deprecated. Replaced by `setCondBranchSpecInfo(java.lang.String, int, java.lang.String, boolean)`.

  Adds a new branch to this `ConditionSpec`, based on the label of an existing arrow. The arguments to this method detail the parameters of the new branch.

  The value must not be longer than specified in `Arrow.MAX_ARROW_NAME_LENGTH`. The process definition must be in edit-mode before calling `addBranchSpec`. Edit-mode is entered by calling `Plan.startEdit`. If this method is called to modify `ConditionSpec` 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/structural edit-mode, calling this method will have no effect.

  This method should not be used anymore. Please, use method `setCondBranchSpecInfo(String, int, String, boolean)` instead! That method adds also a `BranchSpec` to condition specification but futhermore it can throw an exception if the creation or adding of `BranchSpec` fails.

  Parameters:
    `arrowLabel` - Name of the `Arrow`represented by the branch.``
    `op` - The comparison operator of the new branch as defined in the `BranchSpec` interface by constants such as `EQUAL_OP`.
    `value` - The value to compare with a run-time value within the branch comparison.
    `isDefault` - A boolean value that determines whether the new branch is the default.
  See Also:
    `setCondBranchSpecInfo(String, int, String, boolean)`, `Plan.startEdit()`, `ProcessInstance.startStructuralEdit()`

### removeBranchSpec

    public void removeBranchSpec(java.lang.String arrowLabel)
                          throws ModelInternalException

  Removes a `BranchSpec` that represents a branch of this condition specification. Each branch is identified by the name of an arrow.

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

  The process definition must be in edit-mode before calling `removeBranchSpec`. Edit-mode is entered by calling `Plan.startEdit`. If this method is called to modify `ConditionSpec` within a running process instance, also the process instance must be in structural edit-mode. Edit-mode is entered by calling `ProcessInstance.startStructuralEdit`.

  Parameters:
    `arrowLabel` - The name of the `Arrow` that the branch represents.
  Throws:
    `ModelInternalExeption` - When the process definition and/or process instance is not in edit-mode/structural edit-mode when this method is called, or the supplied value is invalid or `null`.
    `ModelInternalException`
  See Also:
    `Plan.startEdit()`, `ProcessInstance.startStructuralEdit()`, `setCondBranchSpecInfo(String, int, String, boolean)`

### setCondBranchSpecInfo

    public void setCondBranchSpecInfo(java.lang.String arrowLabel,
                                      int op,
                                      java.lang.String value,
                                      boolean isDefault)
                               throws ModelInternalException

  Adds a new branch to this `ConditionSpec`, based on the label of an existing arrow. The arguments to this method detail the parameters of the new branch.

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

  The process definition must be in edit-mode before calling `setCondBranchSpecInfo`. Edit-mode is entered by calling `Plan.startEdit`. If this method is called to modify `ConditionSpec` within a running process instance, also the process instance must be in structural edit-mode. Edit-mode is entered by calling `ProcessInstance.startStructuralEdit`.

  Parameters:
    `arrowLabel` - Name of the `Arrow`represented by the branch.``
    `op` - The comparison operator of the new branch as defined in the `BranchSpec` interface by constants such as `EQUAL_OP`.
    `value` - The value to compare with a run-time value within the branch comparison.
    `isDefault` - A boolean value that determines whether the new branch is the default.
  Throws:
    `ModelInternalException` - When the process definition and/or process instance is not in edit-mode/structural edit-mode when this method is called, or the supplied value is invalid or `null`. Should be caught as `ModelException` for future compatibility.
  See Also:
    `Plan.startEdit()`, `ProcessInstance.startStructuralEdit()`, `BranchSpec`

### getBranchSpec

    public BranchSpec getBranchSpec(java.lang.String arrowLabel)
                             throws ModelInternalException

  Returns the branch specification that is linked to an arrow whose label is specified as a parameter.

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

  Parameters:
    `arrowLabel` - Name of the `Arrow`to get the associated branch for.``
  Returns:
    The `BranchSpec` which is associated with the arrowLabel.
  Throws:
    `ModelInternalException` - Thrown if the branch spec for supplied arrow label could not be found.
  See Also:
    `setCondBranchSpecInfo(String, int, String, boolean)`

### getBranchSpecs

    public BranchSpec[] getBranchSpecs()

  Deprecated. Replaced by `getEvalOrder()`.

  Returns an array of branches as arranged at design-time. This method returns an array of branches in the order specified when the `ConditionSpec` was constructed. (If there are none, an empty array is returned.)

### getConditionAttribute

    public java.lang.String getConditionAttribute()

  Returns the name of the User Defined Attribute (UDA) which is the basis of the branching decision. If no condition attribute is defined, an empty `String` is returned.

  Returns:
    The name of the UDA which is used for branch comparisons.
  See Also:
    `setConditionAttribute(String)`

### setConditionAttribute

    public void setConditionAttribute(java.lang.String attributeName)

  Specifies the User Defined Attribute (UDA) which is the basis of the branching decision. The value of this UDA is used at run-time to compare it with the stored value of the `BranchSpec`s.

  The name of attribute must not be longer than specified in `DataItemRef.MAX_DATA_REF_NAME_LENGTH`.

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

  Parameters:
    `attributeName` - Name of the UDA to use for branch comparisons.
  See Also:
    `Plan.startEdit()`, `ProcessInstance.startStructuralEdit()`

### getEvalOrder

    public BranchSpec[] getEvalOrder()

  Returns an array of all existing branches on this condition specification in the order specified by the `setEvalOrder` method. If no eval order is defined, the existing branches are returned in the order of specification at design-time.

  Returns:
    The added `BranchSpec`s in the order of evaluation.
  See Also:
    `setEvalOrder(BranchSpec[])`

### setEvalOrder

    public void setEvalOrder(BranchSpec[] order)

  Stores an ordered array of branches. The order of the branches within this array also defines the sequence of evaluation at run-time.

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

  Parameters:
    `order` - A list of `BranchSpec`s in the order of evaluation at run-time.
  See Also:
    `Plan.startEdit()`, `ProcessInstance.startStructuralEdit()`

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