0

My process involves the CallActivity, and I need to return from the sub-process to the main process. However, using moveActivityIdToParentActivityId would result in the loss of the history records. I want to retain the history records. What should I do?

I have tried moving the current CallActivity from the main process to the previous task node directly. Although this can retain the history records, the variables in the sub-process will not be output to the main process.

Using moveActivityIdToParentActivityId can output sub-process variables to the main process, but the process records will be lost.

Dlin
  • 1

1 Answers1

0

After debugging the source code, it was found that at line 545 in ExecutionEntityManagerImpl.java from /Users/dlin/.m2/repository/org/flowable/flowable-engine/6.8.0/flowable-engine-6.8.0-sources.jar!, the code block below is used to check whether to delete the history records of a process instance:

if (deleteHistory) {
getHistoryManager().recordProcessInstanceDeleted(execution.getId(), execution.getProcessDefinitionId(), execution.getTenantId());
}

Therefore, to preserve the history records, the value of the 'deleteHistory' parameter in the 'safeDeleteSubProcessInstance' method of 'DefaultDynamicStateManager' needs to be overridden.

It is not clear why Flowable does not provide a parameter to control this behavior, but instead hardcodes it in the codebase.

Dlin
  • 1