camunda-bpm-platform
camunda-bpm-platform copied to clipboard
Expose `restartedProcessInstanceId` for historic process instances
Acceptance Criteria (Required on creation)
- [ ] Add new column
restarted_proc_inst_id
toACT_HI_PROCINST
- [ ] Add an index for it
- [ ] Add new field
restartedProcessInstanceId
inHistoricProcessInstanceEventEntity
- [ ] Populate it in
StartProcessInstanceAtActivitiesCmd
via a field ofProcessInstantiationBuilderImpl
- Code: https://github.com/camunda/camunda-bpm-platform/blob/52c98fa0ea1fb47d28f32a01d5efd060f5be9901/engine/src/main/java/org/camunda/bpm/engine/impl/cmd/RestartProcessInstancesCmd.java#L114
- [ ] Expose the new field in REST API
- [ ] document it in OpenAPI
Hints
Links
Breakdown
### Pull Requests
- [ ] https://github.com/camunda/camunda-bpm-platform/pull/4420
I am working on this one
Hi Yana,
Since we are setting the property of restartedProcessInstanceId
through StartProcessInstancesCmd
, I think we can go ahead by setting it in StartProcessInstanceAtActivitiesCmd
too.
This way even the instances created through /process-definition/{id}/restart will have the property set.
I am guessing the restart flow will never go through StartProcessInstancesCmd
at least in the community edition as there is a validation of not null instructions.
This reminds me we need to update the documentation of /process-definition/{id}/restart. It says the field of instructions and instanceId is optional but in the code it validates for not null.
Hi @punitdarira,
Good catch, only StartProcessInstanceAtActivitiesCmd
matters for the restart batch operation so I will adjust the description. Thank you!
This reminds me we need to update the documentation of /process-definition/{id}/restart. It says the field of instructions and instanceId is optional but in the code it validates for not null.
If it's not a big change, feel free to incorporate it to one of your contributions or raise a task for it.
Best, Yana
Hey @psavidis,
It would be great to complete what @punitdarira already started and get it into the 7.22.0 release.
Best, Tassilo
@punitdarira fork is merged to master
. Thank you for your kind contribution.
Closing this ticket.