@@ -39,6 +39,21 @@ import net.corda.core.transactions.SignedTransaction
39
39
*/
40
40
class ClaimCommandService (rpc : CordaRPCOps ) : RPCService(rpc) {
41
41
42
+ /* *
43
+ * Issues a claim.
44
+ *
45
+ * @param claim The claim to issue.
46
+ * @param notary The notary to use for the transaction.
47
+ * @param observers Additional observers of the transaction.
48
+ */
49
+ fun <T : Any > issueClaim (
50
+ claim : CordaClaim <T >,
51
+ notary : Party ? = null,
52
+ observers : Set <Party > = emptySet()
53
+ ): FlowProgressHandle <SignedTransaction > {
54
+ return rpc.startTrackedFlow(IssueClaimFlow ::Initiator , claim, notary, observers)
55
+ }
56
+
42
57
/* *
43
58
* Issues a claim.
44
59
*
@@ -60,12 +75,24 @@ class ClaimCommandService(rpc: CordaRPCOps) : RPCService(rpc) {
60
75
notary : Party ? = null,
61
76
observers : Set <Party > = emptySet()
62
77
): FlowProgressHandle <SignedTransaction > {
63
- return rpc.startTrackedFlow(
64
- IssueClaimFlow ::Initiator ,
65
- CordaClaim (issuer, holder, property, value, linearId),
66
- notary,
67
- observers
68
- )
78
+ val claim = CordaClaim (issuer, holder, property, value, linearId)
79
+ return issueClaim(claim, notary, observers)
80
+ }
81
+
82
+ /* *
83
+ * Amends a claim.
84
+ *
85
+ * @param T The underlying claim value type.
86
+ * @param oldClaim The claim to be consumed.
87
+ * @param newClaim The claim to be created.
88
+ * @param observers Additional observers of the transaction.
89
+ */
90
+ fun <T : Any > amendClaim (
91
+ oldClaim : StateAndRef <CordaClaim <T >>,
92
+ newClaim : CordaClaim <T >,
93
+ observers : Set <Party > = emptySet()
94
+ ): FlowProgressHandle <SignedTransaction > {
95
+ return rpc.startTrackedFlow(AmendClaimFlow ::Initiator , oldClaim, newClaim, observers)
69
96
}
70
97
71
98
/* *
@@ -81,12 +108,7 @@ class ClaimCommandService(rpc: CordaRPCOps) : RPCService(rpc) {
81
108
value : T ,
82
109
observers : Set <Party > = emptySet()
83
110
): FlowProgressHandle <SignedTransaction > {
84
- return rpc.startTrackedFlow(
85
- AmendClaimFlow ::Initiator ,
86
- claim,
87
- claim.amend(value),
88
- observers
89
- )
111
+ return amendClaim(claim, claim.amend(value), observers)
90
112
}
91
113
92
114
/* *
0 commit comments