camunda-bpm-platform icon indicating copy to clipboard operation
camunda-bpm-platform copied to clipboard

Expose `restartedProcessInstanceId` for historic process instances

Open yanavasileva opened this issue 11 months ago • 3 comments

Acceptance Criteria (Required on creation)

  • [ ] Add new column restarted_proc_inst_id to ACT_HI_PROCINST
    • [ ] Add an index for it
  • [ ] Add new field restartedProcessInstanceId in HistoricProcessInstanceEventEntity
  • [ ] Populate it in StartProcessInstanceAtActivitiesCmd via a field of ProcessInstantiationBuilderImpl
    • 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

yanavasileva avatar Mar 22 '24 15:03 yanavasileva

I am working on this one

punitdarira avatar May 20 '24 16:05 punitdarira

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.

punitdarira avatar May 25 '24 02:05 punitdarira

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

yanavasileva avatar May 27 '24 13:05 yanavasileva

Hey @psavidis,

It would be great to complete what @punitdarira already started and get it into the 7.22.0 release.

Best, Tassilo

tasso94 avatar Sep 06 '24 10:09 tasso94

@punitdarira fork is merged to master. Thank you for your kind contribution. Closing this ticket.

psavidis avatar Sep 12 '24 16:09 psavidis