Пример #1
0
  /*
   * (non-Javadoc)
   *
   * @see de.hbrs.oryx.yawl.converter.handler.oryx.OryxHandler#convert()
   */
  @Override
  public void convert() {
    YNet net = getContext().getNet(netShape);

    BasicShape incomingShape = getShape().getIncomingsReadOnly().get(0);
    BasicShape outgoingShape = getShape().getOutgoingsReadOnly().get(0);

    YExternalNetElement incomingElement = net.getNetElement(convertYawlId(net, incomingShape));
    YExternalNetElement outgoingElement = net.getNetElement(convertYawlId(net, outgoingShape));

    if (incomingElement == null
        || outgoingElement == null
        || incomingElement.getID() == null
        || outgoingElement.getID() == null) {
      getContext()
          .addConversionWarnings(
              new ConversionException(
                  "Missing source or target for Edge with ID "
                      + getShape().getResourceId()
                      + " in Net "
                      + net.getID()));
      return;
    }

    YFlow flow = new YFlow(incomingElement, outgoingElement);
    flow.setDocumentation(edgeShape.getProperty("documentation"));

    try {
      convertFlowsInto(flow, incomingShape, outgoingShape, net);
    } catch (JSONException e) {
      getContext().addConversionWarnings("Can not convert flow predicates and ordering", e);
    } catch (ConversionException e) {
      getContext().addConversionWarnings(e);
    }

    convertFlowLayout(incomingElement, outgoingElement, net);

    outgoingElement.addPreset(flow);
  }