camunda-workflow icon indicating copy to clipboard operation
camunda-workflow copied to clipboard

Adding topic detail model

Open dannykopping opened this issue 5 years ago • 7 comments

Adding topic detail model to express additional topic detail requirements in the fetchAndLock call

dannykopping avatar Jan 22 '20 09:01 dannykopping

@amalagaura more just submitting this for your comment - is there a better way we could do this? In my use-case, we need to be able to send the processDefinitionVersionTag param as part of the fetchAndLock call

dannykopping avatar Jan 22 '20 09:01 dannykopping

@dannykopping This seems ok, let me take a look at this and see what else I can find. Give me a day or two.

amalagaura avatar Jan 22 '20 13:01 amalagaura

@dannykopping Any thoughts on using Her's nested attributes? I think it would mean creating a Her model for TopicDetail, which would be unusable. Then we would add a has_many and accepts_nested_attributes_for and then alias topics topics_attributes. But you get the automatic Ruby class for TopicDetail.

amalagaura avatar Jan 22 '20 14:01 amalagaura

OK I see you don't care about the deserialization as much. It is only used for fetch_and_lock. This make sense then. It is just a PORO instead of passing in a hash I see.

amalagaura avatar Jan 22 '20 15:01 amalagaura

OK I see you don't care about the deserialization as much. It is only used for fetch_and_lock. This make sense then. It is just a PORO instead of passing in a hash I see.

Correct, ya. It's purely a request concern As we use the API more and build out more support, it might be a nice idea to create a "request model" concept in the lib which all of these can be based off of

dannykopping avatar Jan 22 '20 15:01 dannykopping

@dannykopping Yes I think I added the fetching and locking as an after thought. It was just a bare minimum. I didn't have any complex requirements for that.

I think your PR will work. You can add tests and I can merge unless you want to add anything else.

amalagaura avatar Jan 22 '20 15:01 amalagaura

Sweet, thanks Ankur - we'll add the tests tomorrow hopefully

dannykopping avatar Jan 22 '20 15:01 dannykopping