# HG changeset patch # User one # Date 1362556633 -32400 # Node ID b17c8a25195ef04fa68d1e6a258bc2b021a12cc7 # Parent 1c13476a0c1f77680941f201caab9362eecb0649 create copyRequestEdges method in ClaimModel. diff -r 1c13476a0c1f -r b17c8a25195e app/models/ClaimModel.java --- a/app/models/ClaimModel.java Wed Mar 06 16:00:15 2013 +0900 +++ b/app/models/ClaimModel.java Wed Mar 06 16:57:13 2013 +0900 @@ -425,6 +425,17 @@ } return null; } + + private void copyRequestEdges(ClaimModel newClaim) { + TPGraph tpGraph = TPGraph.getInstance(); + Iterable reqEdges = getEdgeIterable(Direction.OUT, L_REQUEST); + for (Edge e : reqEdges) { + Vertex userVertex = e.getVertex(Direction.IN); + String userName = (userVertex.getId()).toString(); + String status = (e.getProperty(STATUS)).toString(); + tpGraph.setLabelStatusToUser(newClaim, userName, L_REQUEST, status); + } + } public ClaimModel clone() { TPGraph tpGraph = TPGraph.getInstance(); @@ -433,14 +444,9 @@ String author = (this.getProperty(L_AUTHOR)).toString(); String type = (this.getProperty(TYPE)).toString(); JsonNode toulmin = (JsonNode)this.getProperty(TOULMIN); - Object[] usersObj = getUsersId(); - ArrayList usersList = new ArrayList(); - for (Object o : usersObj) { - usersList.add(o.toString()); - } - tpGraph.setLabelToAuthor(newClaim, author.toString()); newClaim.setClaimProperties(toulmin, type); - + tpGraph.setLabelToAuthor(newClaim, author); + copyRequestEdges(newClaim); return newClaim; }