Automapping rules doesn't support adding custom properties to the Layers?

I have been able to add custom properties to specific objects through automapping rules, but i can’t seem to be able to add them to the Layer output. Is this the expected behavior?

I guess that’s because the automapping system uses several custom properties of its own for configuration purposes. It could be changed such that any unrecognized custom properties on the output layers are just copied over.

1 Like

So how should it behave?
Ignore custom properties on input layers if they don’t match any existing one?
Or only match input layers if they have the same unknown custom property values as the workmap?
And copy custom property values to output layers?

Hmm, the second option is an interesting alternative. You have much more extensive experience with the automapping system than I do, so maybe you can decide?

Yes, I think that’s a sensible thing to do.

I did some cleanups to the automapping code today:

  • 076382c AutoMapper: Fixed object groups always getting added
  • a2fd1aa AutoMapper: Simplified some code
  • a6dc53d AutoMapper: More code cleanups

Some observations:

  • There seems to be no custom properties being read for layers at all. The system only supports some properties at the map level. I am reluctant to add interpretation of custom properties on input layers as being part of the condition, unless you think this is particularly useful.

  • There can be multiple layers resolving to the same output layer, either from multiple rule maps or even in a single rule map by random output index. As such I think copying layer properties is maybe not the best thing to do, since you’d have to keep the properties synchronized on all these layers otherwise your output layers will not have the right properties, depending on which rules are used. Or do you think this behavior would be fine, @TitoOliveira?

1 Like

That makes sense to me.

I don’t think it is worth bothering with custom properties at the input level then.

I don’t have a strong opinion about point 2.

You guys probably know the inner workings of the tool much better than i do, but what i was thinking is that it would be nice to add custom properties on the output layers of the rules. Not necessarily copying them from the input layers, but for my use case i believe that could work too.
I’m not sure how that syncs with what you guys have been discussing.

@TitoOliveira I never suggested to copy properties from the input layers. I tried to explain the possible confusion that may result if users try to rely on copying of properties from output layers.

I see, got it.
I think the behavior that you marked me would be fine. I can see that it requires the user to be better aware of the custom properties he defines across multiple rulesets. But even so it’s a better workflow than having to manually place them after the automapping, imo.
And it also won’t affect anyone who’s not using them, right?

1 Like

Alright, you convinced me. So I’ve now applied the following patch:

Note that the properties will be overwritten when you re-apply the automapping. Let me know if you had expected the properties to only get added when they weren’t already there, then I’ll change that behavior (I am undecided on what is the right thing to do).

1 Like