Launch process dynamically BPT
Question

Hello OS Guru's!

I have build a event service where you can trigger a service action with a parameter TopicKey. Then I have a table with that holds the different topics. For each topic I created a separate process (BPT). I would like to store in the topic table which BPT process is related to it so when a service action is triggered based on the topic key I can see which BPT process to start and then launch it. Would something like this be possible?



mvp_badge
MVP

Hi freek,


If you want to trigger a BPT based on inserting a record in a table, you can leverage on the platform to do that automatically for you. For that, you just need to do two things:


1. Expose your entity to Process Events, by right-clicking your entity and choosing the option Edit entity and then on tab Advanced, make sure you have the option Expose Process Events checked:


2. On your BPT, select the LaunchOn option to the create action of your entity:



This will launch the BPT automatically when you insert a record on that entity.


Kind Regards,
João

Hi Joao,

I would not like to create 10 separate tables and I would also not like to have 1 table and start 10 processed based on that.

So my situation is I have 1 table with 10 different Topic labels in it. How can I start 1 of the 10 different PBT processes based on a value from the topic table. A Ideal situation would be to store the BPT process ID in the topic table so I know what BPT process to launch or something like that.

mvp_badge
MVP

Hi freek,


Usually, applications leverage on the automatic triggers on BPT launching, that's why I suggested.

That may not be the case and if you do want to launch them "manually", you can do so. You can use input parameters on the BPT to have the context, and you get the Process Id after launching the process to save this relation on your entity, like on the image below:


I Joao,

The thing is I want the LaunchProcess action to be dynamic so I did not mean the process id of the launch process but I want to launch the process dynamically instead of building a wrapper and then hardcoded if topic = x then launch process X.

mvp_badge
MVP

What's wrong with creating a wrapper for it?


If you want a different topic to have a different behavior than the others, you should ask yourself if it makes sense for that topic to be in the same table as the other topics.

As I mentioned before, the automatic trigger is based on a create record on the table, not on creating a record of a table with a given attribute value, so either you: a) have an entity to support the automatic trigger or b) you launch it manually.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.