private void setSecondSymbolAsDataSymbol(Symbol secondSymbol, boolean link) {
   if (!(secondSymbol instanceof DataSymbol)) {
     throw new PublicException("The selected Symbol does not represent an activity.");
   } else if ((getDiagram() != null)
       && getDiagram()
           .existConnectionBetween(
               getFirstSymbol(), secondSymbol, DataMappingConnection.class, true)) {
     throw new PublicException("Connection between symbols already exists.");
   }
   data.setElement(((DataSymbol) secondSymbol).getData());
   if (link) {
     generateDefaultMappings();
   }
 }
  private void setSecondSymbolAsActivitySymbol(Symbol secondSymbol, boolean link) {
    if (!(secondSymbol instanceof ActivitySymbol)) {
      throw new PublicException("The selected Symbol does not represent an activity.");
    } else if (((ActivitySymbol) secondSymbol)
        .getActivity()
        .getImplementationType()
        .equals(ImplementationType.Route)) {
      throw new PublicException("A route activity does not participate in data flow.");
    } else if ((getDiagram() != null)
        && getDiagram()
            .existConnectionBetween(
                getFirstSymbol(), secondSymbol, DataMappingConnection.class, true)) {
      throw new PublicException("Connection between symbols already exists.");
    }

    activity.setElement(((ActivitySymbol) secondSymbol).getActivity());
    if (link) {
      generateDefaultMappings();
    }
  }
 public DataMappingConnection(ActivitySymbol firstSymbol) {
   direction = Direction.OUT;
   activity.setElement(firstSymbol.getActivity());
   setFirstSymbol(firstSymbol);
 }
 public DataMappingConnection(DataSymbol firstSymbol) {
   direction = Direction.IN;
   data.setElement(firstSymbol.getData());
   setFirstSymbol(firstSymbol);
 }