If I have a process-level document reference, and a reference to the same document in a web service input/output, CAF generates two different classes, which are a pain to map in Java.
I’ve come up with various bad solutions to this, and no good ones. Here are the bad ones:
- Write all the mapping manually. This is bad because it takes ages and is pretty unmaintainable.
- Use BeanUtils.copyProperties(dest,src). This is useless because it only does a shallow copy.
- Combine the previous two suggestions. This is bad because it’s still pretty unmaintainable, and also brittle.
- Map the copy in a CAF Action. This is bad because then I generate many, many actions on an already cluttered Bindings view, and have to add document references of all the different types to act as temporary variables.
And here would be two of (possibly many) very good answers:
- Here’s a setting, Rob, that lets you make bean code recognise that two document types are equivalent, so they use the same document type. It will survive regenerating web service bindings and refreshing business data from IS.
- Here’s a method, Rob, which is specifically for deep copying from one bean to another of the same structure. Just use that! It’s like a recursive BeanUtils.copyProperties.
Any good answer much appreciated, or if there are none, that would also be helpful to know! Thanks