cancel
Showing results for 
Search instead for 
Did you mean: 

Switch running process instances to newer Process-Model-Version

stephan_bauer
Champ in-the-making
Champ in-the-making
Hi,

I have read http://forums.activiti.org/content/anyone-know-how-fit-such-request
In our case, we have 3 deployed Versions of the business process.

All relevant instances are currently waiting in an Event-Gateway, and the Event-GW still exists in the latest version. The cookbook described at the bottom of the above topic, doesn't fit exactly, because in our case it's not "act_ru_task" that needs to be updated, but "act_ru_execution". I am aware of the fact, that there are 2 executions for each process instance. The simple question is: Is it really sufficient to just update the proc_def_id_ of all these entries in "act_ru_execution" to the value of the latest process modell version?

We are using Activiti 16.3.

Many thanks in advance,
Stephan
9 REPLIES 9

jbarrez
Star Contributor
Star Contributor
In theory yes, if the process is closely matching. If you changed stuff like parallel paths, subprocesses etc where the execution currently is at, then it won't be as easy.

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Stephan,

In your case I would check subscriptions too (there is reference to process definition id too. You will need to upgrade reference.

Regards
Martin

stephan_bauer
Champ in-the-making
Champ in-the-making
Hi Martin,

thanks for the hint. I checked the act_ru_event_subscr table with the following select statement, but the proc_def_id_ in act_ru_event_subscr is empty in all records. It seems activiti doesn't use it (yet or anymore?).

select ex.id_, ex.proc_def_id_, ex.is_active_, ex.proc_inst_id_, sub.id_, sub.proc_inst_id_, sub.execution_id_, sub.activity_id_, sub.proc_def_id_
from act_ru_execution ex
INNER JOIN act_ru_event_subscr sub on ex.id_ = sub.execution_id_;

Many thanks!
Stephan

jbarrez
Star Contributor
Star Contributor
>  but the proc_def_id_ in act_ru_event_subscr is empty in all records. It seems activiti doesn't use it (yet or anymore?).

It is set for a start event (eg timer), but not for runtime event subscriptions. So in your case, no updates required there.

stephan_bauer
Champ in-the-making
Champ in-the-making
Hi again,
now we have done the migration and in the database, all proc_def_id_ s of the corresponding Businessprocess are updated to the latest version. But when I go into the activiti-explorer and check the "Process definitions of running instances" under "Administration" then activiti still tells that the number of instances of the old proc_def_id_s is still the same as before the update. Do I have to reset some cache?
I mean, we had shutdown the appserver before doing the sql-update and so i would have expected not to see any deprecated cache-entries anyway…
Thanks again,
Stephan

trademak
Star Contributor
Star Contributor
Hi Stephan,

Did you also update the history tables of Activiti, or only the runtime tables?

Best regards,

stephan_bauer
Champ in-the-making
Champ in-the-making
Hi Tijs,

first we only updated the runtime tables. We were not sure if it makes sense to update history tables as well…
Then we tried with the following update-statement:

update act_hi_actinst set proc_def_id_='XXXXXXX:4:6740072' where proc_def_id_='XXXXXXX:1:2512' and end_time_ is null
Query returned successfully: 37079 rows affected, 12423 ms execution time.

But this didn't have any impact on the activiti-explorer screen. I suppose there are some more updates to do? Although I'm still a bit confused that the statistics, that this page displays relies on history-tables…(?)

Many thanks,
Stephan

jbarrez
Star Contributor
Star Contributor
It could very well be those screens use historic tables, the history also reflects the runtime state of a process instance.
So I would update the act_hi_proc_inst table too, now you've only changed the ativity instances table, which is most likely not used for that screen.

stephan_bauer
Champ in-the-making
Champ in-the-making
indeed! after also updating the proc_def_id_ in act_hi_proc_inst table, the activiti-explorer displays the statistics correctly!
Many Thanks!
Stephan