/* * Retrieves the (model) information represented by the symbol. If not set, * the method returns <code>null</code>. */ public Object getUserObject() { // @todo (egypt): this is not nice, maybe we find a way to have a user object always // being a model element; if (activity.isEmpty()) { return null; } return getActivity().findDataMappings(getData(), null); }
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(); } }
private IActivity getActivity() { return (IActivity) activity.getElement(); }
private IData getData() { return (IData) data.getElement(); }
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); }
public String toString() { return "Data Mapping Connection for " + activity.getElement() + " / " + data.getElement(); }