Entity Auto Service Out Parameters Question

I have an entity defined: moqui.security.UserAuthcFactor. In moqui there are Entity Auto Services that are services automatically for an entity that are called like verb#EntityName (for example see below). There are only a few verbs that you can use: create, update, delete, or store. In the example below, I am using the create verb to call an Entity Auto Service. In the local context, I don’t define a primary key, but the Entity Auto Service creates one for me. I would like to know the primary key field (called factorId) that the Entity Auto Service generated. Does the Entity Auto Service automatically return the generated fields, or do I need to figure out what the primary key entry the Entity Auto Service generated another way?

<service-call name="create#moqui.security.UserAuthcFactor" in-map="context" out-map="context"/>

Auto services automatically return the generated primary key which by the way is related to the entity moqui.entity.SequenceValueItem

1 Like

Okay cool thanks. I think I figured that out. Just wondering: Where are the Auto Entity Services defined?

OH, they’re not defined, that’s why they’re “auto” :slight_smile: They figure out what needs to be done from the verb#noun combo without being ever defined

1 Like

Right. That makes sense. They’re not defined as a typical XML service, but do you know where the code is that generates them?

Ah, I suppose perhaps you can maybe start by looking at ./framework/src/main/groovy/org/moqui/impl/service/runner/EntityAutoServiceRunner.groovy but that’s going to be quite a bit of digging around to grok the whole architecture (I’m still learning here myself)

1 Like

Cool. Thanks for that.

We’re all learning, so don’t worry about it.