private void createArc(JSONObject modelElement, int index) throws JSONException { String resourceId = modelElement.getString("resourceId"); // Getting source and target of the arc String target = getArcRelation().getTargetValue(resourceId); String source = getArcRelation().getSourceValue(resourceId); String arcId = "ID" + (5000 + index * 10); String transend, placeend, orientation; // Setting the orientation of the arc if (isTransition(target)) { transend = target; placeend = source; orientation = "PtoT"; } else { transend = source; placeend = target; orientation = "TtoP"; } modelElement.put("transend", transend); modelElement.put("placeend", placeend); modelElement.put("orientation", orientation); CPNArc arc = new CPNArc(); arc.setId(arcId); arc.parse(modelElement); arc.positionAnnotation(getNodePositions()); arc.organizeBendpoints(); getArcs().add(arc); }