DecisionsDev / sample-blockchain-vehicle-lifecycle

This sample illustrates how IBM ODM can be used with HyperLedger Fabric and Composer to implement rule-based Smart Contracts
Apache License 2.0
20 stars 26 forks source link

Data not being sent from Blockchain to ODM Service #25

Closed anushaath closed 6 years ago

anushaath commented 6 years ago

The privateVehicleTransfer transaction calls the ODM service along with the data of dsCallObject. But once the block of code is executed, it always goes to the catch block. screenshot from 2018-04-11 12-23-15

I tested the ODM url using Postman with the same payload, and it gives me the right output.

I think the return post(url, dsCallObject, ) is not sending the JSON object and hence it always redirects to the catch block.

anushaath commented 6 years ago

Also the order is placed by a PrivateOwner participant. But the transfer of vehicle transaction takes a participant Person as input.

transaction PrivateVehicleTransfer extends VehicleTransaction { --> Person seller --> Person buyer o String specialNotes optional } https://github.com/ODMDev/sample-blockchain-vehicle-lifecycle/blob/711307ab38facbdb4320e361cdc9699ba45b64fe/vehicle-lifecycle/models/vda.cto#L122

So actually when you submit a PrivateVehicleTransfer transaction, the Hyperledger Fabric docker image log file shows an error of missing Identity.

stephane-mery commented 6 years ago

I've just updated the sample to run on Fabric 1.1 and Composer 0.19.1. I've made some test on my environment and it seems to work correctly. Can you try again?

stephane-mery commented 6 years ago

Didn't look at the identity issue. We will tackle that in a further major version of this sample, which is not planned at this point.

anushaath commented 6 years ago

Yes, Thanks Stephane. I also found that the reason it didn't work is because I had deleted some fields like deathDetails from the blockchain code, but did not update the java files in ODM. As such, this issue is resolved.