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 DataItemMappingElement

public interface DataItemMappingElement

The purpose of this interface is to define how different User Defined Attributes (UDAs) in a process instance can be copied to data elements in a subprocess and how subprocess data elements can be copied back into the parent process instance when the subprocess is completed.

`DataItemMappingElement` objects are essentially pairs of variables: a source and a target. In addition, each `DataItemMappingElement` sets the direction in which the variable values will be copied.

`DataItemMappingElement` objects can be created with the methods of two classes: at design-time by the methods from the `Node` interface, and at run-time by the methods of the `WorkItem` interface. Independently of which classes are used, the creation of a `DataItemMappingElement` requires the following:

- specifying the ID of the process definition which will be linked to the current process definition or process instance,
- the direction of data flow between the linked processes,
- the name of the data element, i.e. UDA in the parent process definition
- and the data element in the process definition of the subprocess.

Each `DataItemMappingElement` provides a link between two variables, giving the user the freedom to link as many or as few data elements as is needed. In addition, a single source variable can be linked to more than one target variable and vice versa, simply by creating a separate `DataItemMappingElement` for each link.

The process definition for the subprocess and the links between the parent process instance and the subprocess data elements do not need to be designed in tandem. However, if data must be exchanged between the parent process instance and the subprocess, all of the `DataItemMappingElements` must be specified before the subprocess is set and started.

Exceptions. One kind of exception is commonly thrown within this class: `ModelException`. This exception usually wraps one of the following exceptions: `WFServerException`, `WFInternalException` and `ModelInternalException`. `WFServerException` indicates that the server failed to operate normally. `WFInternalException` indicates a problem in the communication between client and server. As its name suggests, `util.ModelInternalException` denotes other problems that are internal to the Model API.

See Also:
  `Plan`, `ProcessInstance`, `Node`, `WorkItem`

Field Summary
`static int` | `IN` Specifies an input type of mapping.
`static int` | `INOUT` Specifies that both input and output mapping is active in the current `DataItemMappingElement`.
`static int` | `OUT` Specifies an output type of mapping.

Method Summary
`boolean` | `equals(DataItemMappingElement element)` Compares the current mapping with the mapping contained in the parameter `DataItemMappingElement`.
`java.lang.String` | `getChildDataItemName()` Returns the name of the target User Defined Attribute (UDA) that belongs to the subprocess.
`java.lang.String` | `getParentDataItemName()` Returns the name of the source User Defined Attribute (UDA) that belongs to the parent process instance.
`boolean` | `isInput()` Evaluates the current mapping to determine whether the value in the User Defined Attribute (UDA) is copied from source to target.
`boolean` | `isOutput()` Evaluates the current mapping to determine whether the value in the User Defined Attribute (UDA) is copied from target to source.

Field Detail

### IN

    public static final int IN

  Specifies an input type of mapping.

  See Also:
    Constant Field Values

### OUT

    public static final int OUT

  Specifies an output type of mapping.

  See Also:
    Constant Field Values

### INOUT

    public static final int INOUT

  Specifies that both input and output mapping is active in the current `DataItemMappingElement`.

  See Also:
    Constant Field Values

Method Detail

### getParentDataItemName

    public java.lang.String getParentDataItemName()
                                           throws ModelException

  Returns the name of the source User Defined Attribute (UDA) that belongs to the parent process instance.

  The source UDA name is set with initialisation of this `DataItemMappingElement`.

  Returns:
    The name of the UDA that belongs to the parent process instance (=source).
  Throws:
    `ModelException`

### getChildDataItemName

    public java.lang.String getChildDataItemName()
                                          throws ModelException

  Returns the name of the target User Defined Attribute (UDA) that belongs to the subprocess.

  The target UDA name is set with initialisation of this `DataItemMappingElement`.

  Returns:
    The name of the UDA that belongs to the subprocess (=target).
  Throws:
    `ModelException`

### isInput

    public boolean isInput()
                    throws ModelException

  Evaluates the current mapping to determine whether the value in the User Defined Attribute (UDA) is copied from source to target.

  Returns:
    `true` if the UDA of the parent process instance (=source) is copied to the UDA of the subprocess (=target). `false` for the other direction.
  Throws:
    `ModelException`

### isOutput

    public boolean isOutput()
                     throws ModelException

  Evaluates the current mapping to determine whether the value in the User Defined Attribute (UDA) is copied from target to source.

  Returns:
    `True` if the UDA of the subprocess (=target) is copied to the UDA of the parent process instance(=source). `false` for the other direction.
  Throws:
    `ModelException`

### equals

    public boolean equals(DataItemMappingElement element)
                   throws ModelException

  Compares the current mapping with the mapping contained in the parameter `DataItemMappingElement`. The comparison contains: mapping for direction, parent process instance User Defined Attribute (UDA) and subprocess UDA.

  Parameters:
    `element` - The `DataItemMappingElement` to which this one will be compared.
  Returns:
    `True` if the current mapping is the same as the parameter `DataItemMappingElement`. `False` otherwise.
  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