Allow process to start on Entity Update
942
Views
13
Comments
New
Backend

Launching a process on a record create is great but it would be significantly more useful if we can also launch on a generic Update rather than only on update of a specific record.

For example, we want to hook in some API events where a notification occurs on every Add, Update or Delete. Currently we can do the Add but to do the update we have to set a conditional Update process on EVERY record meaning thousands of processes.

Yes it has been mentioned in the forums that good design would mean you have just one update function and you can add to that but using that theory the launch on Add is unnecessary so why have one without the other?

The Launch On actions of processes are really good for extending functionality of an “entity” espace without having to continually touch the original code every time so I think adding an Update launch is a valid condition.

A launch On Delete would also be useful for some people but no important for us as we do a soft delete which would be caught by the update

I can't see it being too hard to achieve, should just be an on update trigger on the database side


2018-10-29 13-00-29
Magda Pereira
Changed the category to
Backend

Hi John,

I voted for your idea!

But as a workaround look at the next video from NextStepn2019 Amsterdam.

https://www.outsystems.com/nextstep/?wchannelid=lxt52ix89e&wvideoid=zow8f0qc8q#videos

I think it is a great workaround to implement what you want right now.

Regards,

Daniel


Merged this idea with 'Launch BPT on Update and/or Delete' (created on 20 Aug 2019 10:03:09 by Joey Moree)

I'd love to be able to setup some BPT processes on Delete or Update actions, instead of just Create. (I could create a seperate entiy just for this BPT in which I only create something, but that means I have to edit all kinds of wrappers to include this extra create)


This way I can more easily create logs, or inform external systems about the removal of an entity without letting the user wait for it.

Changed the category to
Backend

Hi Joey,

You can actually use Launch on Update in BPT: try the conditional start.

This is not possible in BPT Light (there is another discussion on that) and i don't think its possible on Delete either.

So i think its a good idea, but now you know you can already implement the Launch on Update ;)

I can't STAND using conditional start like this. Joey's idea is the right one. :)

J.Ja

Merged this idea with 'Make possible to launch a process on entity Update' (created on 16 Feb 2021 14:13:10 by Igor Kirtak)

There should be possibility to launch a process on entity update, not just on create as it is now.


What is actually the reason that this is not available? This uses database trigger, which supports both cases, isn't it?

Some can say that there are workarounds for this. To summarize advices which I read or found myself:

1. Launch a process on entity's OnCreate and have conditional start inside. This is not very good option for a table which can have millions of records - I wouldn't want to have millions of processes hanging infinitely. Sometimes it can be that there is clear condition to finish such process, but in my practice more often then not there is none, and such process will hang forever.

2. Very interesting solution in this video https://www.outsystems.com/nextstep/2019/?wchannelid=lxt52ix89e&wmediaid=zow8f0qc8q - unfortunately doesn't work because there is no way to get the ID of the updated record. Or am I missing something?

3. Launch a process from inside the Entity_Update custom action, which will be the only update entry point. This just goes against architectural best practices. A process is higher level then the entity update action, and often it is separate module.

4. Similar to previous, but Create another "event" entity and insert into it when update happens. And then consumers can use this as process launch event. And then ideally delete the records to keep it clean. This seems to be the best option, and which we are using, but it is still an extra workaround of what should not be an issue in the first place.

Hi Igor,


The solution in the video ("singleton" process) should work.

If you make the conditional start trigger on the update of "SomeBPTEntity" the conditional start node will have (as an output) the Id of the row in SomeBPTEntity that caused that launch. You can then use it in the subsequent logic (see below - I can do things inside that Automatic Activity below)

Cheers,


Miguel

Miguel,


Thanks a lot for this hint! I was able to make it work after some playing around.

The problem was I have set Id to Null() to get rid of the warning shown. In this case the output doesn't appear. It took me some time to understand this.


But if I leave it empty - it does appear, however the warning is annoying, and my natural behavior was to "fix" it.

Unfortunately I am not able to edit the idea to correct it in that part.


I have always been VERY afraid of conditional start over performance concerns.

J.Ja

Changed the category to
Backend