rajni pathania
rajni pathania

Reputation: 1

How to pass map parameter in corda flow start command

flow start TransactionRecoveryFlow report: {O=PartyB, L=New York, C=US=LedgerSyncFindings(missingAtRequester=[24DC1B1C6D8743988C5F4DE6725C64D4354B713D78F27E60CF03398B32657D57, FD3F0A5D8E03A9E8B79229B8271DCEDA691AE106A99F38E5F9F0408FB1F1BAFA, A997737DC3359FE7F3D15CB06E12EF347DA149328F263D2B35F99DA8F363EFCB], missingAtRequestee=[])}

I am trying to pass report parameter in flow through command line which is a map of type "Map<Party, LedgerSyncFindings>" . How to pass value to it from command line.

I am getting mutliple syntax errors in output.

exception: while parsing a flow mapping in 'reader', line 1, column 11: { report: {O=PartyB, L=New York, C=US=Ledg ... ^ expected ',' or '}', but got [ in 'reader', line 1, column 77: ... SyncFindings(missingAtRequester=[24DC1B1C6D8743988C5F4DE6725C64D ... ^ at [Source: (StringReader); line: 1, column: 77] - while parsing a flow mapping in 'reader', line 1, column 11: { report: {O=PartyB, L=New York, C=US=Ledg ... ^ expected ',' or '}', but got [ in 'reader', line 1, column 77: ... SyncFindings(missingAtRequester=[24DC1B1C6D8743988C5F4DE6725C64D ... ^ at [Source: (StringReader); line: 1, column: 77] - while parsing a flow mapping in 'reader', line 1, column 11: { report: {O=PartyB, L=New York, C=US=Ledg ... ^ expected ',' or '}', but got [ in 'reader', line 1, column 77: ... SyncFindings(missingAtRequester=[24DC1B1C6D8743988C5F4DE6725C64D ... ^ [errorCode=1eyuahe, moreInformationAt=https://errors.corda.net/OS/4.5/1eyuahe]

Upvotes: 0

Views: 211

Answers (1)

Adel Rustum
Adel Rustum

Reputation: 2548

According to this answer, a list is passed like this:

flow start MyFlow listParam: [value1, value2]

Following the above approach, a map should be passed like this:

flow start MyFlow mapParam: [key1:value1, key2:value2]

In your code sample, you're missing the brackets [ ] around the map, and the colon : between your key/value pairs.

Also, pay attention to how you pass objects in the shell (see here).

Upvotes: 1

Related Questions