Allow redefining entity built-in actions

By Acácio Porta Nova on 22 Jan 2011
There are plenty of scenarios in which the base built-in actions are not enough. For example, if creation of a specific entity record demands that other entity records be also created, or if certain restrictions apply that cannot be modeled with static "default values". Or simply because you want to audit operations over sensitive entities.

Currently the way to do this with the Agile Platform is clumsy: isolate entities in their own eSpace, make them available read-only, and create sets of actions to do the required tasks. This works, but:
  • It is ugly - when actually using those actions, you will not see them associated with entities; you need to remember that they need to be imported, look for them under "referenced actions", remember from which eSpace they come from - or go look in the entity list;
  • It can lead to errors - if a new developer in a project using the pattern, for some reason, is not properly informed, he might simply go into the eSpace and switch the read-only property off, anticipating that it being that way was an error.
José Gomes20 Jul (4 weeks ago)

One pattern that is usually followed is that for every entity, we expose them as public but read only. For that entities, we create our own CRUD actions to give us more control on database manipulation. 

My suggestion is that we can have some scaffolding actions that automatically create that server actions to be called from external modules, for example, right click on the entity -> generate CRUD actions.




Merged from 'Automatically generate CRUD server actions for entities' (idea created on 2017-07-20 05:50:15 by José Gomes), on 2017-07-21 07:53:33 by Gonçalo Borrêga
Leonardo Fernandes21 Jul (4 weeks ago)

I would prefer to customize the existing entity actions.

Much like the OnBeforeRequest/OnAfterResponse methods of REST services are able to change the request/response, we could have a way of customizing the logic for persisting and retrieving the entity from the database.



Merged from 'Automatically generate CRUD server actions for entities' (idea created on 2017-07-20 05:50:15 by José Gomes), on 2017-07-21 07:53:33 by Gonçalo Borrêga
Paul Schmeddes21 Jul (4 weeks ago)

I also prefer customizing the existing entity actions the REST services alike. This leaves scaffolding intact and ensures that the added logic is always executed. 

We also create our own public crud server actions. Within the entity's espace one still can use the entity actions, to prevent this we must check the usage during code reviews.



Merged from 'Automatically generate CRUD server actions for entities' (idea created on 2017-07-20 05:50:15 by José Gomes), on 2017-07-21 07:53:33 by Gonçalo Borrêga
J.21 Jul (4 weeks ago)

similar to https://www.outsystems.com/ideas/624/allow-redefining-entity-built-in-actions ?




Merged from 'Automatically generate CRUD server actions for entities' (idea created on 2017-07-20 05:50:15 by José Gomes), on 2017-07-21 07:53:33 by Gonçalo Borrêga