In the fluent API, I see that we can call TxnUpdater.setProperty to add set a single property after a Txn object has been created but why isn't there a way to call TxnBuilder.setProperty or TxnBuilder.setPropertyMap to set propertie(s) at the initial creation of the Txn object?
Not sure what you mean or how you came to that conclusion. Can you elaborate on your use case?
My use case it to create a Txn object using the TxnBuilder with a property of "ApplicationID" and a value of "1234". How can I do that?
These properties would be part of the txn.propertyMap
Are you doing this in a unit test script or as a genuine solution requirement? Can you describe the business use case. What behavior are you seeing when you try this?
This is being done in a unit test script so that I can can pre-populated the txn with the expected properties before passing the txn to my service for testing. There is no business use case for now other than the ability to facilitate my tests.
Thanks for the context, can you paste your code.
Here is my code from the unit test. The service code being tested is a bit large to past in this format:
Note, that I cannot initially create the Txn object with the "applicationID" property. I have to updated it and then query again to get the updated Txn object.
So just to confirm your code actually works, nothing is broken. You're just asking for a more convenient way to write it?
Correct, I could use the TxnUpdater and then TxnQuery but it would make more sense (and is easier) to initalize the Txn's Property Map during the construction of the Txn value object using the TxnBuilder especially since Txn is a value object and is immutable.
This is really a feature request. Feature requests put through the Q&A Forum will not get picked up by the product team. On the Avoka Community Home Page you find a section on Contributing Ideas to improve the product.