Add the 'Generated' property for process actions and process variables

Related products: Software Factory

I would like to have the ‘Generated’ property available for process actions and process variables. (Possibly process steps as well since these are dependent on process actions and might cause errors during generation if these aren’t generated as well)

I am running into problems with partially generated process flows. A process flow can have the ‘Generated’ property in the SF but individual process actions and process variables cannot. This causes some issues when adding process actions/variables through the dynamic model. To manage these generated process actions and variables, we have to write code to check for them and delete/update them when needed. This is functionality that is available for most other objects in the SF by default.

There is also the problem that dynamic model code to manage these object without the ‘Generated’ property can only be executed after the other generated objects are automatically deleted and re-created through the generation process. (Because it is impossible to execute code from the dynamic model before the ‘delete generated objects’ process during generation.) In some cases this causes errors during generation when these objects are dependent on objects that do have the ‘Generated’ property.

I’ve noticed that these objects do have a ‘Generation’ group label under ‘Trace info’ but the only column available there is ‘By control procedure’. Does this indicate that the ‘Generated’ property is planned to be added in a later release?

Hi,

The generated_by_control_proc_id column is/will be the replacement for the generated column.

We are currently in the middle of phasing out the Generated (bit) column and replacing it by the generated_by_control_proc_id (text) column. During the Generate definition process, Generated = 1 objects are deleted automatically but in the next version, that will also include the generated_by_control_proc_id generated objects (more information on that later).

Partly generated Process flows are possible but that will mean you have to be careful using the Generated = 1 on objects as objects either have to be dropped in the correct order or should not be dropped at all. The process flow in this case cannot be dropped as, like you said, it's partially generated. In a future SF release this will be easier to control as a developer.

 

So for what you can do now is to make your own Dynamic model control procedure creating the objects for the process flow that you desire, then fill the field generated_by_control_proc_id with the name of the Dynamic model procedure. In your procedure, you can drop the objects if needed, update if needed or insert if needed based on the value of that column. Example in pseudo-code:

delete from process_action
where generated_by_control_proc_id = @control_proc_id

delete from process_variable
where generated_by_control_proc_id = @control_proc_id


insert process_variable
(columns)
select
column1 = 1,
column2 = 2,
generated_by_control_proc_id = @control_proc_id

insert process_action
(columns)
select
column1 = 1,
column2 = 2,
generated_by_control_proc_id = @control_proc_id

With the above example you can probably figure out how the rest of the code should be structured. Do keep in mind, you don't have to drop all created objects. You can also update the values that have been changed and only drop the objects that should be deleted because a dependency has been removed for example.


That is exaclty how I’ve currently solved this. It does get tricky when generated object use the manually generated objects because it causes errors at generation. Manually generating these objects as well solves this.

The new way of generating using the  generated_by_control_proc_id in a future release seems like fantastic improvement. I look forward to using it.


Can I close the idea in that case? Since the Generated column will not be added


Updated idea status NewClosed